Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .directive("plunkerUserPane", ["collectionsManager", function(collectionsManager) {
- var getAuth = function($http){
- $http.get('/user/auth').success(function(response) {
- if (response.isAuth) {
- return 'user.html';
- } else {
- return 'userPane.html';
- }
- });
- };
- return {
- restrict: "E",
- replace: true,
- template: '<div ng-include src="userPane.getTemplate()"></div>',
- controllerAs: "userPane",
- controller: ["$scope", "$http", "login", "visitor", function($scope, $http, login, visitor) {
- this.visitor = visitor;
- this.getTemplate = function() {
- var template = 'userPane.html';
- template = getAuth($http);
- return '/components/userPane/' + template;
- }
- this.showLoginWindow = function() {
- login.open();
- };
- }]
- };
- }])
Add Comment
Please, Sign In to add comment