S
S
Sergey2016-11-08 03:40:57
JavaScript
Sergey, 2016-11-08 03:40:57

How to save model/view state in angular2?

It is necessary that when you call clickBack (Back button)

import {Location} from '@angular/common';

@Component({
...
})
export class DetailComponent {
    constructor(private location: Location ) {
    }

    clickBack (){
        // this.router.navigate(['media'], {replaceUrl: true});
        this.location.back();
    }
}

returned to the previous view with the saved model data (for example, with an already matched table, etc...)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2016-11-08
@healqq

Store data in services.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question