Skip to content

Instantly share code, notes, and snippets.

@alecklandgraf
Last active June 28, 2016 01:01
Show Gist options
  • Save alecklandgraf/ec160c9140d2cd019fec5c6363263a30 to your computer and use it in GitHub Desktop.
Save alecklandgraf/ec160c9140d2cd019fec5c6363263a30 to your computer and use it in GitHub Desktop.
hello2 component
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