npm install -g karma error MSB4019: The imported project “C:\Microsoft.Cpp.Default.props” was not found

For those that still run into errors after installing a VS with Windows SDK and trying Besrl’s solution, in particular node-gyp failing with Error MSB4019: The imported project “X:\Microsoft.Cpp.Default.props” was not found, Try running the npm install commands from a MSVS command prompt. Find it at Start menu > Microsoft Visual Studio 201X > Visual … Read more

Force HTTP interceptor in dynamic ngSrc request

Based on Michal’s answer the directive could look like the below app.directive(‘httpSrc’, [ ‘$http’, function ($http) { var directive = { link: link, restrict: ‘A’ }; return directive; function link(scope, element, attrs) { var requestConfig = { method: ‘Get’, url: attrs.httpSrc, responseType: ‘arraybuffer’, cache: ‘true’ }; $http(requestConfig) .then(function(response) { var arr = new Uint8Array(response.data); var … Read more

AngularJS Dynamic loading a controller

Re-reading this article http://ify.io/lazy-loading-in-angularjs/ suggested to keep a $contentProvider instance inside Angular App. I came up with this code in my app.js demoApp.config(function ($controllerProvider) { demoApp.controller = $controllerProvider.register; }); It enables me to write my controller as expected in a external javascript file : angular.module(“demoApp”).controller(‘MouseTestCtrlA’, fn); Hope this can help !

Using expression `(“&”)` binding to pass data from AngularJS component to parent scope

tl;dr; see Demo below You are using expression binding. angular.module(‘app.dashboard’) .component(‘dashboardComponent’, { templateUrl: ‘app/dashboard/directives/dashboard-container.html’, controller: DashboardComponent, controllerAs: ‘DashboardCtrl’, bindings: { onTileChange: “&” } })t To communicate event data from a component to a parent controller: Instantiate the dashboard-component with: <dashboard-component on-tile-change=”HomeCtrl.onTileChange($tile)”> </dashboard-component> In the component controller invoke the function with locals: this.onTileChange({$tile: tile}); The convention … Read more

how do I get ng-include directive to work with a Content Delivery Network?

Yes, you are right – the problem is with cross-domain call. Official docs say: By default, the template URL is restricted to the same domain and protocol as the application document. This is done by calling $sce.getTrustedResourceUrl on it. To load templates from other domains or protocols you may either whitelist them or wrap them … Read more