Last active
June 28, 2016 01:01
-
-
Save alecklandgraf/ec160c9140d2cd019fec5c6363263a30 to your computer and use it in GitHub Desktop.
hello2 component
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
module.component('helloNavFetch', { | |
controller: ['Me', function(Me) { | |
var ctrl = this; | |
this.$onInit = function () { | |
ctrl.loading = true; | |
Me.query().$promise.then(function (me) { | |
ctrl.me = me; | |
ctrl.loading = false; | |
}); | |
}; | |
}], | |
template: `<div class="section-nav"> | |
<h2 ng-if="!$ctrl.loading">Hello {{ $ctrl.me.first_name }} {{ $ctrl.me.last_name }}</h2> | |
<h2 ng-if="$ctrl.loading">Hello <i class="fa fa-spin fa-spinner"></i></h2> | |
</div>` | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment