As a part of learning process, I am
roaming around angular js routing concepts. For this, I created one inner folder inside
app with two sample test html pages ..
When i
run the app it should load first page from that folder but it does not not happening ..
I am not sure where i have done wrong in this
code...
I am getting error like this
'angular.js:4640Uncaught Error:
[$injector:modulerr]'
Below is my
controller code
var
myApp = angular.module('myApp', ['ngRoute']);
myApp.config(function
($routeProvider) {
$routeProvider
.when('/',
{
templateUrl: 'Pages/main.html',
controller:
'mainController'
})
.when('/second',
{
templateUrl: 'Pages/second.html',
controller:
'secondController'
})
});
myApp.controller('mainController', ['$scope','$log', function($scope,$log) {
}]);
myApp.controller('secondController', ['$scope','$log',
function($scope,$log) {
}]);
and
html code goes here
html>
Learn and Understand
AngularJS
content="IE=Edge">
charset="UTF-8">
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
src="https://code.angularjs.org/1.5.8/angular.min.js">
src="https://code.angularjs.org/1.5.8/angular-route.min.js">
No comments:
Post a Comment