Skip to content

Instantly share code, notes, and snippets.

@molcik
Last active July 13, 2018 14:16
Show Gist options
  • Select an option

  • Save molcik/0fc89934d2f5d17b626af71ca81d03b5 to your computer and use it in GitHub Desktop.

Select an option

Save molcik/0fc89934d2f5d17b626af71ca81d03b5 to your computer and use it in GitHub Desktop.

Revisions

  1. molcik revised this gist Jul 13, 2018. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions angular-local-storage.md
    Original file line number Diff line number Diff line change
    @@ -10,12 +10,6 @@ export class SomeComponent {
    @LocalStorage
    public variableToBeStored: string;

    }


    export class SomeComponent {

    /** Attributes */
    @SessionStorage
    public variableToBeStored: string;

  2. molcik revised this gist Jul 13, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion angular-local-storage.md
    Original file line number Diff line number Diff line change
    @@ -24,4 +24,4 @@ export class SomeComponent {

    ## Decorators

    Decorator files for Local and Session storage can be find on [my blog](https://filipmolcik.com/angular-2-local-storage/)
    [Examples](https://filipmolcik.com/angular-2-local-storage/)
  3. molcik revised this gist Jul 13, 2018. 1 changed file with 18 additions and 2 deletions.
    20 changes: 18 additions & 2 deletions angular-local-storage.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    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/

    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/)
  4. molcik revised this gist Jul 13, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions angular-local-storage.md
    Original 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 */
  5. molcik renamed this gist Jul 13, 2018. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion angular-local-storage.ts → angular-local-storage.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,11 @@


    ```
    export class SomeComponent {
    /** Attributes */
    @LocalStorage
    public variableToBeStored: string;
    }
    }
    ```
  6. molcik created this gist Jul 13, 2018.
    7 changes: 7 additions & 0 deletions angular-local-storage.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    export class SomeComponent {

    /** Attributes */
    @LocalStorage
    public variableToBeStored: string;

    }