A
A
Angularity2017-03-07 15:02:43
JavaScript
Angularity, 2017-03-07 15:02:43

How to implement LocalStorage in Angular 2 without HTTP?

I need to create authentication with LocalStorage in Angular 2 + Typescript.
I need advice how can I do this without HTTP? How can I initialize this repository to work with it?
I would appreciate links with examples.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2017-03-07
@AppFA

Even I did not quite understand what the problem is? In what sense how to initialize?

localStorage.setItem('token', 'some token');
const token = localStorage.getItem('token');

A
Artem, 2017-03-18
@free_doom

localStorage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question