Skip to content Skip to sidebar Skip to footer

Don't Work $compile In Jasmine Karma Angular

(function () { 'use strict'; angular .module('app.widgets') .directive('analiticsHere', analitics); function analitics() { var directive =

Solution 1:

Try following code

inject(function($injector){
        compile = $injector.get("$compile");
        scope = $injector.get("$rootScope").$new();
        template =$injector.get("$templateCache").get('scripts/widgets/templates/Analytics.html');
        console.log(template);
        var element = angular.element('<div analitics-here></div>');
        var compiledElement = compile(element)(scope);
        console.log('compiledElement'); class="ng-scope"></div>
    });

Post a Comment for "Don't Work $compile In Jasmine Karma Angular"