Following code displays log messages that get fired when state transitions happen,
watch for the error messages, in case any exists, if 404 is found for a requested object
check the templateURL naming the state shows in the developer tools console
Add the following to the html were angular is activated ie: anywhere into index.html.erb given that application.html.erb has angular activated
<script>
angular.element(document).ready(function(){
// Credits: Adam's answer in http://stackoverflow.com/a/20786262/69362
// Paste this in browser's console
var $rootScope = angular.element(document.querySelectorAll("[ui-view]")[0]).injector().get('$rootScope');
$rootScope.$on('$stateChangeStart',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeStart to '+toState.to+'- fired when the transition begins. toState,toParams : \n',toState, toParams);
});
$rootScope.$on('$stateChangeError',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeError - fired when an error occurs during transition.');
console.log(arguments);
});
$rootScope.$on('$stateChangeSuccess',function(event, toState, toParams, fromState, fromParams){
console.log('$stateChangeSuccess to '+toState.name+'- fired once the state transition is complete.');
});
$rootScope.$on('$viewContentLoaded',function(event){
console.log('$viewContentLoaded - fired after dom rendered',event);
});
$rootScope.$on('$stateNotFound',function(event, unfoundState, fromState, fromParams){
console.log('$stateNotFound '+unfoundState.to+' - fired when a state cannot be found by its name.');
console.log(unfoundState, fromState, fromParams);
});
console.log("Some testing line");
});
</script>
In the index.html (or any html file that gets rendered) add the following snippets
<div ui-view>here</div>
<a ui-sref="MainState">Click Here to goto MainState</a>
<a ui-sref="SecState">Click Here to goto SecState</a>
or
<ui-view/>
<a ui-sref="MainState">Click Here to goto MainState</a>
<a ui-sref="SecState">Click Here to goto SecState</a>
That way when we click on some Click Here text we'll get a state transition with it's log messages.
after requiring javascripts and javascripts/templates
examples that worked/didn't work