service
$compile
包含directive
所有属性的说明 传送门
service basic
service and factory比较 (provider behind the scene)
- factory create obj and return it
- service only create constructor and let angular do the rest of work
|
|
|
|
provider
|
|
nodejs/express demo
|
|
$templateCache - service in module ng
The first time a template is used, it is loaded in the template cache for quick retrieval.
You can load templates directly into the cache in a script tag, or by consuming the $templateCache service directly.
Adding via the $templateCache service:
1234var myApp = angular.module('myApp', []);myApp.run(function($templateCache) {$templateCache.put('templateId.html', 'This is the content of the template');});To retrieve the template later, simply use it in your component:
123myApp.component('myComponent', {templateUrl: 'templateId.html'});
or get it via the $templateCache service:
1$templateCache.get('templateId.html')