Last active
August 29, 2015 14:01
-
-
Save ichiban/ec2cc203cd30aa1defb7 to your computer and use it in GitHub Desktop.
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
angular.module('app').controller('MainController', ['$scope', 'userResource', function($scope, userResource) { | |
$scope.current = {}; | |
$scope.$watch('current.user', function(user) { | |
if (user) { return; } | |
var user = userResource(); | |
user.then(function(user) { | |
$scope.current.user = user; | |
}); | |
}); | |
}]); |
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
<body> | |
<div class="main-controller" ng-app="postmore.ideas" ng-controller="MainController" ng-class="{'bg-base':!current.user}"> | |
<div ng-view></div> | |
</div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment