Skip to main content
This dot in the template content will trigger an error while running the function
Source Link

What I ended up doing was getting the template cache and putting the view in there. I don't have control over not using ngMock, it turns out:

beforeEach(inject(function (_$rootScope_, _$compile_, $templateCache) {
    scope$scope = _$rootScope_;
    $compile = _$compile_;
    $templateCache.put('path/to/template.html', '.<template-'<div>Here goes-here the template</>'div>');
}));

What I ended up doing was getting the template cache and putting the view in there. I don't have control over not using ngMock, it turns out:

beforeEach(inject(function (_$rootScope_, _$compile_, $templateCache) {
    scope = _$rootScope_;
    $compile = _$compile_;
    $templateCache.put('path/to/template.html', '.<template-goes-here />');
}));

What I ended up doing was getting the template cache and putting the view in there. I don't have control over not using ngMock, it turns out:

beforeEach(inject(function(_$rootScope_, _$compile_, $templateCache) {
    $scope = _$rootScope_;
    $compile = _$compile_;
    $templateCache.put('path/to/template.html', '<div>Here goes the template</div>');
}));
Source Link
Jesus is Lord
  • 15.5k
  • 11
  • 72
  • 103

What I ended up doing was getting the template cache and putting the view in there. I don't have control over not using ngMock, it turns out:

beforeEach(inject(function (_$rootScope_, _$compile_, $templateCache) {
    scope = _$rootScope_;
    $compile = _$compile_;
    $templateCache.put('path/to/template.html', '.<template-goes-here />');
}));