Questions tagged [angular-templatecache]

gulp-angular-templatecache - Concatenates and registers AngularJS templates in the $templateCache.

GulpJS plugin that combines all your HTML template partials into 1 JS module that can be concatenated into your final app.min file.

Links:

71 questions
19
votes
3 answers

How to fix template paths in templateCache? (gulp-angular-templatecache)

I'm using gulp-angular-templatecache to generate a templateCache.js file which combines all my HTML template files into 1. (my full gulpfile) After injecting that new module into my app, my Directives will automatically pick up the templates and I…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
6
votes
3 answers

angularJS $stateProvider : How to unit test different views in UI-Router?

How can I unit test different views for the below scenario .state('app.sr.product.upload', { name: 'upload', url: '/upload', data: { tags: [], userCommunities: [] }, …
5
votes
0 answers

Using $templateCache with template vs templateUrl

I am using grunts ng-template to store the html templates in the $templateCache. The angular docs suggest that I can use the template like this: myApp.component('myComponent', { templateUrl: 'templateId.html' }); or like this: …
Denis Chizhik
  • 141
  • 1
  • 7
5
votes
2 answers

Override $templateCache to be case insensitive

Can one override core provider like $templateCache while maintaining reference to the original provider ? I'd like to override $templateCache to be case insensitive. I.E. something like var normalGet = $templateCache.get; var normalPut =…
5
votes
1 answer

Can't bind to 'ngforOf' since it isn't a known native property

Can't bind to 'ngforOf' since it isn't a known native property

Colors bad boys

  • ]*ngfor="#color of colors"> {{color.color | upperCase}}
  • Trying to load the template via TemplateParser…
Vladimir Ivanov
  • 51
  • 1
  • 1
  • 2
4
votes
0 answers

angular template cache doesn't work when template key contains file extension

Template cache fails for me for some reason, when I do this: angular.module('myApp').run([ '$templateCache', function ($templateCache) { $templateCache.put('test.html', 'content'); } ]); and then when using…
3
votes
1 answer

How to build unified $templateCache when migrating AngularJS 1.x project from gulp & bower to webpack 3

Have a large AngularJS 1.6 project (~120 JS files), which is currently built through gulp/bower. Looking to migrate over to using yarn & webpack, and we would prefer not to have to modify our project files just to implement webpack. Each of our…
SmileyJoe
  • 51
  • 3
3
votes
1 answer

Angular 1.x Testing with Jasmine: Compiling a template not working to verify data output in template

I am trying to unit test an html template that has variables in paragraph, anchor tags, and {{header.title || translate}} however no matter what posts I have tried it does not seem to work. I get the retrieved HTML template and when it is compiled…
2
votes
1 answer

How to load a remote template using $templatecache.put()

I have read the documentation for $templateCache but I'm still struggling to understand how to load remote templates into the cache using the put function. Below is an example: onBoardingApp.run(function ($templateCache, $http) { …
vegas2033
  • 250
  • 1
  • 4
  • 16
2
votes
0 answers

Using angular's templateCache in case of large apps

I am working on optimizing a pretty large angularjs application with 100+ templates. I use grunt for automation. What i am trying to achieve here is that i need to prefix all the urls in my production code with a cdnUrl as I plan to host static…
Vinay
  • 723
  • 9
  • 32
2
votes
0 answers

AngularJS inside MVC, preloading static HTML or MVC partial views to use @templateCache to make app offline?

We have an MVC project with AngularJS sitting on top of it. Question - is possible to preload static HTML files (partial templates) into templateUrl property for Angular's custom components or directives. If it is possible, can I use Angular's…
2
votes
1 answer

gulp-angular-templatecache fails to find the the template file it creates

We are developing a web application using AngularJS and ASP.NET Web API. There is a dev machine set up with GoCD that deploys the app after every commit to dev branch in our github repo. We are using gulp to build the frontend but after the last…
edo.n
  • 2,184
  • 12
  • 12
2
votes
1 answer

Dynamic include template angular directive

So I want to make a directive to automatically include tabs and content, but I am unable to get the content stored in partials/tabs/tab[x].html. AvailableTabs - constant defined as an array : myApp.constant("availableTabs", [ {name:'tab1',…
2
votes
3 answers

How can I utilise my templateCache module in my Jasmine tests?

I do NOT want to use karma-ng-html2js-preprocessor or $httpBackend. I have a templateCache module which I created dynamically. app.js angular.module('myApp', ['ngRoute', 'ui.bootstrap', 'ui.router', 'appTemplates']); templates.js (function(){ 'use…
colincclark
  • 174
  • 1
  • 13
1
vote
0 answers

Putting template in template cache before rendering angular js

I have created a directive to put element html code in template cache- .directive('putInCache', function ($templateCache) { return { link: function (scope, element) { $templateCache.put('name', element.html()); } …
1
2 3 4 5