You need to sign in to do that
Don't have an account?
bujji
Uncaught ReferenceError: angular is not defined at app:2
Hi Guys,
I am new bee to use angularjs in salesforce. Below is my code which is working fine when i put the below snippet in script tag in the same page.
var app = angular.module('myApp', []);
app.controller('myctrl', function ($scope) {
<!--$scope.contacts = {!contacts} -->
$scope.fname = 'Test1';
$scope.lname = 'Test2';
});
But when i put the above code in app.js static resource and refrenced <apex:includeScript value="{!$Resource.app}"/> it is throwing the error.
angular is not defined.
Could anybody tell me what is the wrong i am doing.
Thanks,
Bujji.
I am new bee to use angularjs in salesforce. Below is my code which is working fine when i put the below snippet in script tag in the same page.
var app = angular.module('myApp', []);
app.controller('myctrl', function ($scope) {
<!--$scope.contacts = {!contacts} -->
$scope.fname = 'Test1';
$scope.lname = 'Test2';
});
But when i put the above code in app.js static resource and refrenced <apex:includeScript value="{!$Resource.app}"/> it is throwing the error.
angular is not defined.
Could anybody tell me what is the wrong i am doing.
Thanks,
Bujji.
The name is :
My first expression: {{ 5 + 5 }}
First Name:
Last Name:
Full Name: {{fname+" "+lname}}
AngularJS Objects Name is: {{person.p1}} {{person.p2}}
AngularJS Array Animal Names are: First Animal is:{{animals[0]}} Second Animal is:{{animals[1]}}
{{x.name+', '+x.country}}
Thanks, Baji Shaik.
That isn't super helpful.
But the problem is that your script isn't finding angular.
You need to make sure that you're referencing angular on the page BEFORE your script: