Skip to content

Commit cd7e28e

Browse files
committed
New version for Meteor packaging system
1 parent 4b286e8 commit cd7e28e

File tree

3 files changed

+30
-57
lines changed

3 files changed

+30
-57
lines changed

ngMeteor.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

package.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Package.describe({
77
Package.on_use(function (api) {
88
api.versionsFrom('METEOR@0.9.0.1');
99
// Exports the ngMeteor package scope
10-
api.export('ngMeteor', 'client');
10+
api.export('urigo:ngmeteor', 'client');
1111

12-
api.use('jquery', 'client');
12+
api.use('jquery', 'client');
1313

1414
// Files to load in Client only.
1515
api.add_files([

urigo:ngmeteor.js

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22
ngMeteor = 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]]
1522
ngMeteor.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

Comments
 (0)