When trying to custom elements with Angular, I have made different routes, and they work. Problem is some custom elements won't load.
I have a page that is using Angular Route to handle different views like so:
angular.module("appRoutes", ["ngRoute"])
.config(function($routeProvider, $locationProvider) {
$routeProvider
// Route for the home page
.when("/", {
templateUrl : "../views/home.html",
controller : "homeController",
controllerAs : "home"
})
// Route for Credits
.when("/credits", {
templateUrl : "../views/credits.html",
controller : "creditsController",
controllerAs : "credits"
});
$locationProvider.html5Mode(true);
});
All the CSS and JS files are called in the index.html file. The CSS at the beginning of the file, the JS at the end of the index.html file. I tried moving the JS imports to the top of the file, however that did not change anything.
The custom elements I'm trying to use are Slider Revolution and Owl Carousel. When I place the content of home.html directly into index.html everything works perfectly.
However, when I try to keep the content of home.html inside of home.html and just load the content using my view. The elements inside the Revolution Slider and Owl Carousel will not work, the images do not load, and the "skeleton" of both of them do not work.
Additionally I tried placing the CSS and JS file imports inside the home.html view and that did not work either.
I have no idea of how to fix it. I imagine it's some kind of issue with the Javascript for Owl Carousel and Revolution Slider not being able to interact with the view inside of home.html since the CSS in general is working with no issues.
Thanks for taking the time to read all of that, any and all help is greatly appreciated.
home.htmlfile isn't affected by the Javascript and thus rendered useless. I would appreciate any approach that fixes this behavior.ng-routernested view is not loading the javascript contained in the parent view after loading the child view. Still no idea of how to solve this, will keep investigating.