parent
a45c193eb1
commit
6870bd1e9b
@ -1,5 +1,8 @@
|
||||
var app = angular.module('SinsApp', []);
|
||||
|
||||
app.controller('MainController', function(){
|
||||
this.foo = 'bar'
|
||||
app.controller('HeaderController', ['$http', function($http){
|
||||
var controller = this;
|
||||
$http.get('/session').success(function(data){
|
||||
controller.current_user = data.current_user;
|
||||
});
|
||||
}]);
|
||||
|
||||
@ -1 +1,11 @@
|
||||
oh hai!
|
||||
<header ng-controller="HeaderController as header">
|
||||
<h1>Welcome page</h1>
|
||||
<p>
|
||||
Welcome {{header.current_user.email}}
|
||||
<p>
|
||||
<nav>
|
||||
<h2>Navigation</h2>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
</main>
|
||||
|
||||
Loading…
Reference in new issue