0

I'm very new to Angularjs. I have managed to install eclipse plugin for Angularjs and started a simple code. When i have the below code, the expressions are evaluating properly. I have visited similar problems reported in stackoverflow ad have tried all suggestions, but in my case, i just evaluate {{ 7 + 8}} which is straight forward. Please any help here is appreciated. Thanks.

<html ng-app>

As soon as i change to poing ng-app to my module, the page breaks and expressions are not evaluating.

<html ng-app = "corpo">    --> Fails

myapp.html

<html ng-app>
<head>
<script type="text/javascript" src="corp/WebContent/corp.js"></script>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>

<title>Corp</title>
</head>
<body>
<div>
    <p>{{ 7 + 19 }}</p>
</div>

</body>
</html>

corp.js

var corp = angular.module('corpo', []);

Also i keep getting undefined javascript file and i have disabled the validation under properties.

4 Answers 4

1

Put corpo below of angular library

Like this

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
<script type="text/javascript" src="corp/WebContent/corp.js"></script>
Sign up to request clarification or add additional context in comments.

5 Comments

Thanks, Tried this and no luck. :(
Sure.. <html ng-app = "corpo"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script> <script type="text/javascript" src="corp/WebContent/corp.js"></script> <title>Corp</title> </head> <body> <div> <p>{{ 7 + 19 + 1 }}</p> </div> </body> </html>
nope, this is what i see in the console. `Tern response# with 38ms: {} {"query":{"type":"angular","subtype":"type","angularTypes":["module"],"expression":"corpo","scope":{},"files":["WebContent/corp.js","WebContent/angular.js"],"file":"WebContent/corp.html"}} Tern request#angular_type: Tern response#angular_type with 22ms:
did your corp.js in right path ? corp/WebContent/corp.js
wow thanks, i did change from src="corpWebContent\corp.js" to src="corp.js" and that fixed it... Awesome, i initially had this written correctly, but eclipse was complaining about undefined javascript error and had changed this but forgot to revert.
0
Its failing because you have injected corp.js before angular.min.js
corp.js after angular.min.js, it will start working

1 Comment

hmm, changed it and cleared the cache, still no luck
0

var corp = angular.module('corpo', []);
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<html ng-app="corpo">
<head>
<title>Corp</title>
</head>
<body>
<div>
    <p>{{ 7 + 19 }}</p>
</div>

</body>
</html>

change this

<src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js">        </script>
 <script type="text/javascript" src="corp/WebContent/corp.js"></script>

3 Comments

oops, that was a typo when i posted the question. :( and i corrected it now in the question.
@Freaky1 I update my answer. you must put crop.js after angular.js
@Freaky1 Please see this.
0

I think your "corp.js" is not in the right path.

working plunker demo

Post your application directory structure. I am sure the problem is with that.

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.