The event handler attached with jQuery(window).load
will run when the page is fully loaded. However, ng-view
hasn't loaded your view yet, which means doesn't exist.
Move the initialization into a directive:
myApp.directive('flexslider', function () {
return {
link: function (scope, element, attrs) {
element.flexslider({
animation: "slide"
});
}
}
});
And use like this:
Demo: http://plnkr.co/edit/aVC9fnRhMkKw3xfpm4No?p=preview