I'm trying to create an carousal from the scratch using Angular. So my html code relevant to the issue is as follows.
<div id = "section1" class = "" ng-app = "sliderApp">
<div class = "sec1_slider" ng-controller = "app">
<div class = "slider_image">
<img ng-src="{{ imageUrlProfile }}" class = "sm_icon">
And I have imported the relevant APIs.
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.5/angular-route.js"></script>
My Angular Code is as follows.
var application = angular.module('sliderApp', ['ngRoute']);
application.controller('app', function($rootScope, $scope) {
$rootScope.imageUrlProfile = 'slider-img1.png';
});
In the landing page, the image i defined in angular code 'slider-img1.png' is not loading and throws the following error in browser console.
angular.js:4073 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.5/$injector/modulerr?p0=sliderApp&p1=Refere…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.5%2Fangular.min.js%3A16%3A463)
Click here to see the link to the error.
what should I do to load the image ?
<script type="text/javascript" src = "js/app.js"></script>ProfileCtrl,WorkCtrl,EduCtrl, that's why you get error Failed to instantiate module sliderApp due to: ReferenceError: ProfileCtrl is not defined, so possibly in your code same error