Write angular JS Code in two minutes
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.
.png)

Hi there, what does this actually do?
ReplyDelete