Skip to content

Instantly share code, notes, and snippets.

@alecklandgraf
Last active August 30, 2016 00:16
Show Gist options
  • Save alecklandgraf/b7e0c9ad9964c0f2f8842b6071b9ecce to your computer and use it in GitHub Desktop.
Save alecklandgraf/b7e0c9ad9964c0f2f8842b6071b9ecce to your computer and use it in GitHub Desktop.
Profile Component with Routing
const Component = {
template: `...`,
bindings: {
userData: '<'
}
};
angular
.module('App.pages.profile', [uiRouter, meServiceModule])
.component('profile', Component)
.config(($stateProvider, $urlRouterProvider) => {
'ngInject';
$stateProvider
.state('profile', {
url: '/profile',
component: 'profile',
resolve: {
userData: meService => meService.fetchMe()
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment