Skip to content Skip to sidebar Skip to footer

Angular 1.5 Test Component With Jasmine

I try test my component with Jasmine and Angular-mock, but I don't know how this do. This is my component var angular = require('angular'); 'use strict'; module.exports = angular

Solution 1:

You use $componentController.

beforeEach(inject(function($rootScope, $componentController){
  scope = $rootScope.$new();
  controller = $componentController('myComponent', {$scope: scope});
}));

Post a Comment for "Angular 1.5 Test Component With Jasmine"