I noticed that on my initial homepage load, my viewContentLoaded is firing twice, why is that ?
app.run(function
($rootScope,$log) {
'use strict';
$rootScope.$state = $state;
$log.warn("gets here");
$rootScope.$on('$viewContentLoaded',function(){
$log.warn("gets here2");
});
});
Output on page load
"gets here"
"gets here2"
"gets here2"
And my routing as follows
$urlRouterProvider.when('', '/');
// For any unmatched url, send to 404
$urlRouterProvider.otherwise('/404');
$stateProvider
.state('home', {
url: '/',
templateUrl: 'views/search.html',
controller: 'SearchCtrl'
})
My Index.html
<div id="canvas">
<ng-include src="'views/partials/header.html'"></ng-include>
<!-- container -->
<div ui-view ></div>
<!-- /container -->
<ng-include src="'views/partials/footer.html'"></ng-include>
</div>