Created
June 1, 2016 13:50
-
-
Save russiann/c90fab727031ff7e1af73dedaa88a866 to your computer and use it in GitHub Desktop.
compile
This file contains hidden or 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
this.$rootScope.$on('f7:pageBeforeInit', (e, data) => { | |
const pageData = data.detail.pageData; | |
this.$F7Router.findRouteByUrl(pageData.url) | |
.then((route) => { | |
const config = route.config; | |
const navbar = data.detail.pageData.navbarInnerContainer; | |
const $scope = this.$rootScope.$new(); | |
this.$controller(config.controller, {$scope}, null, config.controllerAs); | |
this.$timeout(() => { | |
var template = angular.element(pageData.container); | |
this.$compile(template)($scope); | |
if (navbar) { | |
var navbarElement = angular.element(navbar); | |
this.$compile(navbarElement)($scope); | |
} | |
}); | |
}) | |
.catch((err) => { | |
console.warn(err); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment