Skip to content

Commit acb6af4

Browse files
committed
Merge pull request #55 from stlouisweb/patch-1
adds hook to re-compile document after iron-router
2 parents eb3e81f + e54db3d commit acb6af4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

urigo:angular.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ var onReady = function () {
2828
angular.bootstrap(document, ['angular-meteor']);
2929
}
3030

31-
// Recompile whenever the DOM elements are updated.
32-
var notifyParented = Blaze.View.notifyParented;
33-
Blaze.View.notifyParented = function () {
34-
notifyParented.apply(this, arguments);
35-
if (this.region) {
31+
// Recompile after iron:router builds page
32+
if(typeof Router != 'undefined') {
33+
Router.onAfterAction(function(req, res, next) {
3634
Tracker.afterFlush(function() {
3735
angular.element(document).injector().invoke(['$compile', '$document', '$rootScope',
3836
function ($compile, $document, $rootScope) {
@@ -41,7 +39,7 @@ var onReady = function () {
4139
}
4240
]);
4341
});
44-
}
42+
});
4543
}
4644
};
4745

@@ -51,4 +49,4 @@ if (Meteor.isCordova) {
5149
}
5250
else {
5351
angular.element(document).ready(onReady);
54-
}
52+
}

0 commit comments

Comments
 (0)