Jeff_Yu
Jeff_Yu

Reputation: 13

how to update the templateCache in angularJs

angular.module('genTemplates', []) .run(['$templateCache', function($templateCache) { $templateCache.put('admin-article.html', '<div>......</div>'); ...... }]);

ok,i am new to angularJs. what i puzzled is, i've changed the content in admin-article.html but the value of the key 'admin-article.html' remain unchanged....,maybe there are some tools needed to do this?i need your help - - !

Upvotes: 1

Views: 1411

Answers (1)

Alexander Kerchum
Alexander Kerchum

Reputation: 532

You can try:

$templateCache.remove('admin-article.html');

Make sure you are actually having problems with $templateCache, you can open inspector in Chrome, click on the 'Network' tab and refresh the page. You will be able to tell then if it is actually loading your updated template or not.

Upvotes: 1

Related Questions