-2

I am using Angularjs but when i try to use the ng-controller function having give it a name of "Appctrl" and using the two way binding of double curly braces it gives me the following error: Use of inputEncoding is deprecated. opt_content.js:1:804247 unreachable code after return statement

4
  • you are missing quite a bit of context here that would help us to help you find an answer. This is the sort of question which should have some sort of minimal reproducible example accompanying it. Also, opt_content.js isn't an angularjs file, so it's unlikely that the problem is with angular or with ng-controller. Commented Jan 2, 2016 at 22:22
  • I am trying to display a contact list through my controller which i have initialized to "Appctrl" but when i write the "function Appctrl($scope){...}" and try to run it having started my server it gives me the following error: "Error: [ng:areq] errors.angularjs.org/1.3.14/ng/… M/<@localhost:3000/ajax.googleapis.com/ajax/libs/angularjs/1.3.14/… bla bla bla Use of inputEncoding is deprecated. opt_content.js:1:804247 unreachable code after return statement.I dont understand please assist Commented Jan 2, 2016 at 22:34
  • Your comment doesn't really say anything different from your question body, except that you listed a new error there that you didn't list in the question body (you should consider editing the question body). However, even with this new error, this is still not something that an outsider can help solve without seeing the code that is creating the error. Commented Jan 2, 2016 at 22:37
  • without seeing any code I can't say for sure, but your comment seems to suggest that you are declaring Appctrl as a global function rather than an angular controller, which is no longer a valid syntax. see github.com/angular/angular.js/commit/…. Commented Jan 2, 2016 at 22:44

2 Answers 2

0

Use ng-model for two way binding..

Ex :

Enter Name :<input type ="text" ng-model="username">
Hello : {{username}}
Sign up to request clarification or add additional context in comments.

Comments

0

This looks like it might not be related to angular, but without a code snippet cannot be 100% sure. Here is a working example with the test case provided by you. Things that could have gone wrong:

  • you're missing ng-app in your html or attribute's value is not the same as the name of your root angular module
  • controller is not defined/used properly

Furthermore, I think the error you mentioned actually consists of two separate warnings:

  • Use of inputEncoding is deprecated: could be related to ExQuilla browser addon. Can you verify that warning exists cross-browser? If not, can you check if it persists after you disable all plugins for the problematic browser?
  • opt_content.js:1:804247 unreachable code after return statement. The second part means there is some code in the file, which is placed after a return clause and won't be executed. But quick google search points out that the opt_content.js file might actually be related to some malware.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.