Currently, I'm using:
I am aware of my current implementation might be deprecated, just looking for the implementation(an example or documentation) of the new method. Any help is greatly appreciated, thanks in advance!
Current implementation:
'use strict';
module.exports = angular
.module('common', [
'ui.router',
'angular-loading-bar',
require('./header').name,
require('./sideBar').name,
require('./footer').name
])
.run(function($transitions, cfpLoadingBar) {
$transitions.onStart({}, cfpLoadingBar.start);
$transitions.onSuccess({}, cfpLoadingBar.complete);
});
Current error:
Uncaught Error: [$injector:unpr] Unknown provider: $transitionsProvider <- $transitions
What are the components of good transition sentences? They make an explicit connection between ideas, sentences, and paragraphs. Good transitions use specific words. Try to avoid using pronouns like “this” to refer to an entire idea because it is not always clear who or what “this” refers to.
As you write, use transition words to help you organize information effectively. Transitions can help signal connections between a main idea and supporting ideas. They can also signify comparisons or contrasts, and transition words are an excellent way to introduce and identify related concepts.
Examples of Transitions: On the contrary, contrarily, notwithstanding, but, however, nevertheless, in spite of, in contrast, yet, on one hand, on the other hand, rather, or, nor, conversely, at the same time, while this may be true.
In new versions (>=1.0.0) the $state change events are deprecated, and now you have to use the
$transitions
instead...
$transitions for new versions (>= 1.0.0) (PLUNKER DEMO)
MyCtrl.$inject = ['$transitions'];
function MyCtrl($transitions) {
$transitions.onSuccess({}, function($transition){
console.log($transition.$from());
console.log($transition.$to());
console.log($transition.params());
});
}
Available events ordered by invocation:
$transitions.onStart({}, function($transition){...});
$transitions.onExit({exiting: "stateName"}, function($transition){...});
$transitions.onRetain({}, function($transition){...});
$transitions.onEnter({entering: "stateName"}, function($transition){...});
$transitions.onFinish({}, function($transition){...});
$transitions.onSuccess({}, function($transition){...});
Too see each event method in detail: $transition service docs
Also some examples: Migrations examples from 0.4.2 to 1.0.0 in official docs
$state changes events for old versions (<= 0.4.2) (PLUNKER DEMO):
MyCtrl.$inject = ['$scope'];
function MyCtrl($scope) {
$scope.$on('$stateChangeStart',
function(event, toState, toParams, fromState, fromParams, options) {...});
$scope.$on('$stateChangeSuccess',
function(event, toState, toParams, fromState, fromParams, options){...});
}
Check angular-ui-router docs for more $state change events
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With