Posts

Showing posts from February, 2019

Setting Up Your Angular CLI App to Generate Code Coverage Reports Any Time Tests Are Run in a Workspace with Multiple Projects

I currently do development in an Angular CLI application that contains multiple library projects, and recently enabled code coverage reports to be generated automatically every time unit tests were run. This consisted of 4 steps: Turn on code coverage for each project. Exclude the libraries from coverage in projects that utilized them (each library has its own coverage). Set the output directory for each project's code coverage report to a sub-directory of the code coverage directory to avoid overwriting files for each report generated. Make additions to ignore the code coverage directory from source control. Here's each of these steps in detail. Step 1: Turn on code coverage for each project In angular.json , go to the architect/test/options  node for each project and add a property called codeCoverage  if it's not already there. Set the value to true , as shown below: "test" : { "builder" : "@angular-devkit/build-angular:

How to Set Who Gets Notified When a Data Extension Import Occurs in Marketing Cloud

Some time ago, I created a data extension in Marketing Cloud and somehow set up a way to get an email notification when one of our scheduled processes kicked of an import. But recently, for the life of me, I couldn't figure out how I set up the import notification part, and I was unable to find the setting in the Marketing Cloud UI. Finally, with a little Googling, and by narrowing down what I was searching by, I found it. Here's how you can set the email address to have the Data Extension Import Notification sent to.  Hopefully this can help someone else in the same situation. 1. From the main Marekting Cloud dashboard, select Contact Builder under the Audience Builder menu. (While I had been trying to figure all of this out I had been looking at the Data Extension configuration, and then tried looking for the Import Definition -- I couldn't image it would be under the Contact Builder  section.) 2. Select Imports from the top nav bar. 3. Find the import definition

How To Set Up Extra Application Initialization in an Angular App

Image
Angular includes a constant called APP_INTIALIZER. As of the time of this writing, the Angular docs page on it looks like this: I'm pretty sure they've updated the page since the first time I looked at it, at which point it said even less than what is shown above. And even the expanded documentation above isn't exactly clear as to how to use this. So I'll elaborate. In your app's module file, you can declare a provider that provides APP_INITIALIZER . And you can tell it to use a certain function via the useFactory property. For example, in my app.module.ts, I import my environment constant which contains environment-specifc config settings, and I've declared a function called initializeApp()  which initializes my AppConfigService  with envrionment : import { environment } from '../environments/environment' ; export function initializeApp ( appConfigSvc : AppConfigService ) { return () => { appConfigSvc . init ( en