I am trying to code the below sample program in Angular js using Sublime Text. I have already included the angular package in Preferences. The code doesnn't work when I give the src for angular as src="angular.min.js", where as it works I give the src as src="https://code.angularjs.org/1.4.0/angular.js". How do I link the src correctly on my computer?
2 Answers
Just download the reference that you use and save it as angular.min.js on the same folder where your app is.
Also no need to have multiple ng-app mentioned in the div.
If you are having a separate controller defined, it is necessary to define the ng-app with the module name and mention the controller in the view.
6 Comments
Ranjith King
I gave the source as src="C:\Desktop\angular.min.js" and it worked. So does this mean that, if I have to use angular-animate.min.js, then should I give another source link to animate in this format - src="C:\Desktop\angular-animate.min.js"
Sajeetharan
You dont have to use animate at all. just angular.min will work. I dont recommend to give desktop path. just put inside the folder
Ranjith King
I tried to put it in the same folder, where the sublime text is, and it didnt work. Also put it in the packages folder of sublime text, still didnt work.I have already placed, Angular JS folder in the browse packages folder.
Ranjith King
yes, it shows this error Failed to load resource: net::ERR_FILE_NOT_FOUND
Ranjith King
Thanks a lot Sajeetharan,it worked. I had been trying to put it in the Sublime text folder and not in folder where the source .html file is. By app I had understood it as the text editor. Now it works once I put the angular.min.js in the folder where the source code is.
|
