Last active
December 11, 2015 21:29
-
-
Save zshamrock/4663214 to your computer and use it in GitHub Desktop.
AngularJS UI Bootstrap templatePrefix
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
angular.module("ui.bootstrap", ["ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.carousel","ui.bootstrap.collapse","ui.bootstrap.dialog","ui.bootstrap.dropdownToggle","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tabs","ui.bootstrap.tooltip","ui.bootstrap.transition","ui.bootstrap.config"]); | |
angular.module("ui.bootstrap.config", []).value("ui.bootstrap.config", {templatePrefix: "template"}); | |
... | |
angular.module('ui.bootstrap.pagination', ["ui.bootstrap.config"]) | |
.directive('pagination', ["ui.bootstrap.config", function(uiBootstrapConfig) { | |
return { | |
restrict: 'EA', | |
scope: { | |
numPages: '=', | |
currentPage: '=', | |
maxSize: '=', | |
onSelectPage: '&' | |
}, | |
templateUrl: uiBootstrapConfig.templatePrefix + "/pagination/pagination.html", | |
replace: true, | |
... | |
// In my app (simplified), instead of <applicationContext> I use real application context, of course: | |
angular.module("app", [ | |
... | |
"ui", | |
"ui.bootstrap" | |
]) | |
.value("ui.bootstrap.config", {templatePrefix: "/<applicationContext>/template"}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment