Created
December 3, 2015 20:56
-
-
Save Hendrixer/10a71040e01b4ad74e3b to your computer and use it in GitHub Desktop.
using resolve with components
This file contains 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.moudle('app', []) | |
.config($stateProvider => { | |
$stateProvider | |
.state('profile', { | |
url: '/profile', | |
template: '<profile-page profile="profile"></profile-page>', | |
controller(profile, $scope){ // use 'function' if minifying | |
$scope.profile = profile; | |
}, | |
resolve: { | |
profile: function(){ | |
return {}; | |
} | |
} | |
}) | |
}) | |
.directive('profilePage', () => { | |
return { | |
scope: { | |
profile: '=' | |
}, | |
// .... rest of config | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment