From d4e3f76c38f4e02cc48b166281471791004cd99a Mon Sep 17 00:00:00 2001 From: Ariel Mashraki Date: Mon, 13 Oct 2014 15:27:32 +0300 Subject: [PATCH] fix(README.md): bind example --- README.md | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c248296..90d95ce 100644 --- a/README.md +++ b/README.md @@ -223,18 +223,27 @@ Bind $scope key to localStorageService. myApp.controller('MainCtrl', function($scope, localStorageService) { //... localStorageService.set('property', 'oldValue'); - var unbind = localStorageService.bind($scope, 'property'); + $scope.unbind = localStorageService.bind($scope, 'property'); //Test Changes - $scope.property = 'newValue1'; - console.log(localStorageService.get('property')) // newValue1; - //unbind watcher - unbind(); - $scope.property = 'newValue2'; - console.log(localStorageService.get('property')) // newValue1; + $scope.update = function(val) { + $scope.property = val; + $timeout(function() { + alert("localStorage value: " + localStorageService.get('property')); + }); + } //... }); ``` +```html +
+

{{property}}

+ + + +
+``` + ###deriveKey Return the derive key **Returns** `String`