Created
September 28, 2015 19:06
-
-
Save dhwang/0d11400f2d398ea1a97a to your computer and use it in GitHub Desktop.
Backular, injecting Angular view into Backbone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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