|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html> |
3 | 3 | <head> |
4 | | - <link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css"> |
| 4 | + <!-- strictly for styling and demo purposes --> |
| 5 | + <link rel="stylesheet" href="http://cdn.jsdelivr.net/foundation/4.3.1/css/foundation.min.css"> |
| 6 | + <link rel="stylesheet" href="assets/style.css"> |
| 7 | + |
| 8 | + <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> |
| 9 | + <link href="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css" rel="stylesheet" type="text/css" /> |
| 10 | + <script src="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.js" type="text/javascript"></script> |
| 11 | + <script type="text/javascript"> |
| 12 | + $(document).ready(function() { |
| 13 | + $("pre", this).addClass("prettyprint"); |
| 14 | + }); |
| 15 | + </script> |
| 16 | + <!-- end unnecessary files for demo --> |
| 17 | + |
5 | 18 | <script src="../components/angular/angular.min.js"></script> |
6 | 19 | <script src="../components/angular-cookies/angular-cookies.min.js"></script> |
7 | | - <script src="../src/localFactory.js"></script> |
| 20 | + <script src="../src/localStorage.js"></script> |
8 | 21 | <script> |
9 | 22 | var eS = angular.module('exampleStore', ['localStorage']); |
10 | 23 |
|
|
20 | 33 | <body> |
21 | 34 | <div ng-app="exampleStore"> |
22 | 35 | <div ng-controller="MainCtrl"> |
23 | | - <p>{{test}}</p> |
24 | | - <label>Local Storage Bound:</label> <input type="text" ng-model="test"> |
25 | | - <a ng-click="clearTest()">Clear Value from LC</a> |
| 36 | + <div class="hero"> |
| 37 | + <h1>the simplest localStorage implementation, <b>ever</b></h1> |
| 38 | + <h3>angular localStorage module</h3> |
| 39 | + </div> |
| 40 | + <div class="row"> |
| 41 | + <div class="large-12 columns"> |
| 42 | + <h2>How to use localStorage module</h2> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + <div class="row"> |
| 46 | + <div class="large-4 columns"> |
| 47 | + <p>Variable: <b>{{test}}</b></p> |
| 48 | + <label>localStorage variable value:</label> <input type="text" ng-model="test"> |
| 49 | + <a ng-click="clearTest()">Clear Value from LC</a> |
| 50 | + |
| 51 | + <p style="font-size: 12px;"><i>Change the value in the textbox and refresh the page!</i></p> |
| 52 | + </div> |
| 53 | + <div class="large-8 columns"> |
| 54 | + <pre> |
| 55 | +var eS = angular.module('exampleStore', ['localStorage']); |
| 56 | + |
| 57 | +eS.controller('MainCtrl', ['$scope', '$store', function ( $scope, $store ) { |
| 58 | + $store.bind($scope, 'test', 'Some Default Text'); |
| 59 | + |
| 60 | + $scope.clearTest = function () { |
| 61 | + $store.remove('test'); |
| 62 | + }; |
| 63 | +}]); |
| 64 | + </pre> |
| 65 | + </div> |
| 66 | + </div> |
26 | 67 |
|
27 | | - <p><i>Change the value in the textbox and refresh the page!</i></p> |
28 | 68 | </div> |
29 | 69 | </div> |
30 | 70 | </body> |
|
0 commit comments