$stateChangeError
- fired when an error occurs during the transition to a state$stateProvider.state('example', {
url: '/example',
controller: 'ExampleController',
resolve: {
user: function(authService) {
return authService.auth.$requireSignIn();
}
}
});
JavaScript
app.directive('myDirective', function() {
return {
restrict: 'E',
scope: {},
templateUrl: 'app/example.html'
}
});
HTML
<my-directive></my-directive>
$getAuth()
- synchronously retrieves the current authentication state$requireSignIn()
- returns the user if authenticated, AUTH_REQUIRED
error if notFork the Meganote Repo to your personal GitHub. Refactor it according to John Papa’s Angular Style Guide and submit a pull request on the original repo when you are done.
.constant
to provide the value of the URL in the requests to the APIRefactor the notes service as a factory
Refactor the notes-form as a directive instead of child state
Mutant Office Hours: Source