我成功编写了create,save,update,delete
代码。如何使用localstorage?编辑弹出窗口无效。
以下是我的代码,
<html>
<head>
<title>KANNA</title>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.1/angular.min.js"></script>
<script src="https://cdn.jsdelivr.net/ngstorage/0.3.6/ngStorage.min.js"></script>
<div ng-app="MyApp" ng-controller="MyController">
<input type="button" value="Save" ng-click="Save()" />
<input type="button" value="Get" ng-click="Get()" />
<input type ="button" value="Edit"ng-click="Edit()"/>
</div>
<script >
var app = angular.module('MyApp', ["ngStorage"])
app.controller('MyController', ['$scope','$localStorage','$sessionStorage','$window',function ($scope, $localStorage, $sessionStorage, $window) {
$scope.Save = function () {
$localStorage.templateUrl ="prakash.html";
$sessionStorage.SessionMessage = "SessionStorage: hai.";
}
$scope.edit=function(){
'prakash.html';
}
$scope.Get = function () {
$window.alert($localStorage.templateUrl+ "\n" + $sessionStorage.SessionMessage);
}
}]);
</script>
</body>
</html>
任何帮助都将不胜感激。