Hi Ku,
I updated your sample to work:
angular
.module('app', []);
.run(function($templateCache, $injector) {
var compare = angular.injector(["ng"]) === $injector
//alert(compare); // false is the correct answer in this case. you
created an new injector that's not linked to the module.
$templateCache.put("something.html","You some actual content here!");
var cached = $templateCache.get("something.html");
alert(cached);
});
When you find the need to use the injector yourself, you have probably a
code-smell. This is not something you should need in a normal app.
May I ask what use case you needed the injector for in the first place?
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.