Last active
July 13, 2018 14:16
-
-
Save molcik/0fc89934d2f5d17b626af71ca81d03b5 to your computer and use it in GitHub Desktop.
Revisions
-
molcik revised this gist
Jul 13, 2018 . 1 changed file with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,12 +10,6 @@ export class SomeComponent { @LocalStorage public variableToBeStored: string; @SessionStorage public variableToBeStored: string; -
molcik revised this gist
Jul 13, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,4 +24,4 @@ export class SomeComponent { ## Decorators [Examples](https://filipmolcik.com/angular-2-local-storage/) -
molcik revised this gist
Jul 13, 2018 . 1 changed file with 18 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ Elegant way how to use Local Storage in Angular app are decorators. So you just decorate your variable with @localStorage or @SessionStorage. ## Usage ```typescript export class SomeComponent { @@ -8,4 +11,17 @@ export class SomeComponent { public variableToBeStored: string; } export class SomeComponent { /** Attributes */ @SessionStorage public variableToBeStored: string; } ``` ## Decorators Decorator files for Local and Session storage can be find on [my blog](https://filipmolcik.com/angular-2-local-storage/) -
molcik revised this gist
Jul 13, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ In your component just decorate your variable with @localStorage or @SessionStorage and you are done reade more here: https://filipmolcik.com/angular-2-local-storage/ ```typescript export class SomeComponent { /** Attributes */ -
molcik renamed this gist
Jul 13, 2018 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,11 @@ ``` export class SomeComponent { /** Attributes */ @LocalStorage public variableToBeStored: string; } ``` -
molcik created this gist
Jul 13, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ export class SomeComponent { /** Attributes */ @LocalStorage public variableToBeStored: string; }