22ngMeteor = angular . module ( 'ngMeteor' , [
33 'ngMeteor.collections' ,
44 'ngMeteor.template' ,
5- 'hashKeyCopier' ,
65 'ngRoute' ,
76 'ngTouch' ,
87 'ngAnimate' ,
98 'ngCookies' ,
109 'ngResource' ,
11- 'ngSanitize'
10+ 'ngSanitize' ,
11+ 'hashKeyCopier'
1212] ) ;
1313
14+ // Method to allow injection of angular modules dependencies into ngMeteor
15+ ngMeteor . injector = function ( modules ) {
16+ angular . forEach ( modules , function ( module ) {
17+ ngMeteor . requires . push ( module ) ;
18+ } ) ;
19+ } ;
20+
1421// Change the data-bindings from {{foo}} to [[foo]]
1522ngMeteor . config ( [ '$interpolateProvider' ,
1623 function ( $interpolateProvider ) {
@@ -20,8 +27,24 @@ ngMeteor.config(['$interpolateProvider',
2027] ) ;
2128
2229// Manual initilisation of ngMeteor
23- angular . element ( document ) . ready ( function ( ) {
24- if ( ! angular . element ( document ) . injector ( ) ) {
30+ angular . element ( document ) . ready ( function ( ) {
31+ if ( ! angular . element ( document ) . injector ( ) ) {
2532 angular . bootstrap ( document , [ 'ngMeteor' ] ) ;
2633 }
27- } ) ;
34+
35+ // Recompiles whenever the DOM elements are updated.
36+ var notifyParented = Blaze . View . notifyParented ;
37+ Blaze . View . notifyParented = function ( ) {
38+ notifyParented . apply ( this , arguments ) ;
39+ if ( this . region ) {
40+ Deps . afterFlush ( function ( ) {
41+ angular . element ( document ) . injector ( ) . invoke ( [ '$compile' , '$document' , '$rootScope' ,
42+ function ( $compile , $document , $rootScope ) {
43+ $compile ( $document ) ( $rootScope ) ;
44+ if ( ! $rootScope . $$phase ) $rootScope . $apply ( ) ;
45+ }
46+ ] ) ;
47+ } ) ;
48+ }
49+ }
50+ } ) ;
0 commit comments