javascript - AngularJS: Argument 'Controller as short' is not a function, got undefined -


I have difficulty finding out what the problem is.

Why is this code (index.html) run

   & Lt; Script type = "text / javascript" src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js" & gt; & Lt; / Script & gt; & Lt; script type = "text / javascript" src = "js / app.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; div class = "list-group-item" ng-repeat = "store.products in product" & gt; & Lt; Section ng-controller = "controller in tab form" & gt; & Lt; / Section & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

While

  & lt ;! DOCTYPE html & gt; & Lt; Html ng-app = "gemStore" & gt; & Lt; Top & gt; & Lt; link rel = "stylesheet" type = "text / css" href = "css / bootstrap.min.css" /> & Lt; Script type = "text / javascript" src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / app.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Section ng-controller = "controller in tab form" & gt; & Lt; / Section & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

Generates an error: 'Error:' TabController 'is not a function in the form of logic tab, not undefined on error (original)

app .js:

  (function () {var app = angular.module ('gemStore', []); app.controller ('StoreController', function () {this.products = gems ;}}; App.controller ("TabController", function () {this.tab = 1; this.isSet = function (checkTab) {return.tab === checkTab;}; this.setTab = function (setTab) { this tab = set tab;};}) var gems = [{data: 'data'}];}) ();   

Thank you very much in advance!

Your problem is the reason that you are referring to Connelry 1.0.6. The "syntax" syntax is not available in the pre-1.2.0 kernel. If you make changes from 1.0.6 to 1.2.0 then it should work fine.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -