Selector
const state = {
username: '@angular/store'
}import { Selector} from 'angular-store';
@Selector('username') $username: Observable<string>; import { Selector} from 'angular-store';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'angular-store-lib'
@Selector('username') $username: Observable<string>;
}
constructor(private store: Store) {
this.$username.pipe().subscribe((lol) => {
// console.log('username', lol);
});
}Last updated