Search code examples
angularjsangularjs-ng-route

ngRoute not working: [$compile:tpload]


Im new to angularjs so its hard for me to figure this thing out. Im getting error of [$compile:tpload]. What could be a problem here? HTML:

<body ng-app="App">
<div ng-view>
    ...
</div>
<a href="#main">Access</a>

JS:

var App = angular.module('App', ["ngRoute"]);
App.config (function ($routeProvider){
 $routeProvider
 .when("/main", {
     templateUrl : "yup.html"
 })
});

yup.HTML:

<p>...</p>

What im doing wrong?


Solution

  • Looks like there is no issue with your code, except that the angular-route.js file is not loading. Change the source link from http to https to get it working. Browser is blocking the url as script through http is insecure. Updated Plunkr