javascript - AngularJS TypeError: undefined is not a function on ng-view directive -


I'm trying to wire a simple angel app and I can not get past is not a function Is error on my visual order The strange thing is that the first scene is actually loaded and given for instruction, but I am unable to navigate my 2nd scene. The controllers are not sure, I'm not sure what's going on here any thoughts?

Angular Version: 1.2.26 (same error with 1.2.20)

Error

 type error: there is no undefined function

app code

  var app = angular Modules ('myApp', ['ngRoute', 'ngResource']); App.controller ('Home', ['$ scope', function ($ radius) {console.log ('Home Controller Hit.');}])); App.controller ('About', ['$ scope', function ($ area) {console.log ('About Administrator Hit.');}]); App.config (function ($ migration provider, $ location provider) {$ locationProvider.html5Mode (true); $ route provider. ('/', {TemplateUrl: 'SiteAssets / views / home.html', Controller: 'Home'}) When. ('About', {templateUrl: 'SiteAssets / views / about.html', Administrator ('/ home', {templateUrl: 'SiteAssets / views / home.html', Controller: 'Home'}) .: 'About'}). Otherwise ({redirectTo: '/'});});    

You need to put $ controller in your controllers like this:

  app.controller ('about', ['$ scope', '$ document', function ($ scope, $ document) {$ document.title = 'about us; console.log ('Hit about the controller.');}]);   

It may be a $ document that is throwing an error, because angular does not know what it is without injection. However, the error for this problem will be a error: Unknown provider:

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

python - 'NoneType' object is not callable using 'find_all' in BeautifulSoup -