Write angular JS Code in two minutes

09:05:00 1 Comments


Hi guys you can create your Angular Js HTML file within two minutes...

Yes this is not a joke but this will help you write at-least write the basic code.

First of all

You will need to create an Angular JS file just a simple HTML file

The you will need to paste the below code into the file


  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.27/angular.min.js"></script>  
     <script src="https://rawgithub.com/gsklee/ngStorage/master/ngStorage.js"></script>  
     <script>  
       var example = angular.module("example", ["ngStorage"]);  
       example.controller("ExampleController", function($scope, $localStorage) {  
         $scope.save = function() {  
           $localStorage.message = "Hello World";  
         }  
         $scope.load = function() {  
           $scope.data = $localStorage.message;  
         }  
       });  
     </script>  
   </head>  
   <body ng-app="example">  
     <div ng-controller="ExampleController">  
       <button ng-click="save()">Save</button>  
       <button ng-click="load()">Load</button>  
       <br>  
       {{data}}  
     </div>  
   </body>  
 </html>  

Just make sure that your internet is connected since I have included CDN script libraries.And you are now done.

Joel

Joel Fernandes,I am a Very Smart,Innovative Creative and One of the Best Webdevelopers.I am an expert in Webdevelopment.My other interest include Cars and Vehicles.My desire is to be the best and serve you with the best information I have .I will always share all my tips and tricks on this website and provide you with the best themes so that your life may be simpler.Keep visiting www.joelwebsites.com for the best website related ,tips and tricks and news.Meet me on FaceBook

1 comment: