Skip to content

Instantly share code, notes, and snippets.

@dhwang
Created September 28, 2015 19:06
Show Gist options
  • Save dhwang/0d11400f2d398ea1a97a to your computer and use it in GitHub Desktop.
Save dhwang/0d11400f2d398ea1a97a to your computer and use it in GitHub Desktop.
Backular, injecting Angular view into Backbone
render: function (el) {
var self = this;
self.$el.empty();
self.$el.html(PageTemplate);
if (!window.quotainjector) {
window.quotainjector = window.angular.bootstrap(document, ['QuotaReportView'])
window.quotainjector.invoke(function($rootScope) {
console.log('invoke self.periodYears',self.periodYears)
$rootScope.$broadcast("quota.period.data", self.periodYears)
});
} else {
window.quotainjector.invoke(function($rootScope, $compile, $document) {
$compile(self.el)($rootScope);
$rootScope.$broadcast("quota.period.data", self.periodYears)
$rootScope.$digest();
});
}
return this;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment