The largest Interview Solution Library on the web


« Previous | 1 | 2 | 3 | Next »
Name:

<html>
<head>
<title></title>
<style type="text/css">
body
{
font-family: Arial;
font-size: 10pt;
}
</style>
</head>
<body>
<script type="text/javascript">
var app = angular.module('MyApp', ['ngCookies']);
app.controller('MyController', function ($scope, $window, $cookieStore) {
$scope.WriteCookie = function () {
$cookieStore.put("Name", $scope.Name);
};
$scope.ReadCookie = function () {
$window.alert($cookieStore.get('Name'));
};
$scope.RemoveCookie = function () {
$cookieStore.remove('Name');
};
});
</script>
<div ng-app="MyApp" ng-controller="MyController">
Name:
<input type="text" ng-model="Name" />
<br />
<br />
<input type="button" value="Write Cookie" ng-click="WriteCookie()" />
<input type="button" value="Read Cookie" ng-click="ReadCookie()" />
<input type="button" value="Remove Cookie" ng-click="RemoveCookie()" />
</div>
</body>
</html>
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com