I worked a bit with Angular and I tried to implement simple routing. I have basic HTML that contains a link to all the necessary scripts and the ng-view tag.
For some reason, when the page is loaded, the template does not appear in the ng-view location. Why is this not shown, and how to fix it?
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular-route.js"></script> <script src="routCtrl.js"></script> </head> <body ng-app='ngRouteTest'> <div ng-view></div> </body>
and script file:
var ngRouteTest = angular.module('ngRouteTest',['ngRoute']); ngRouteTest.config(function($routeProvider){ $routeProvider .when('/', {templateUrl : '/routView1.html'}) });
source share