I have the following statement:
I get an object from somewhere like the following in the example:
paginationConfig = { 'currentPage': 1, 'pageSizes': [5, 10, 15], 'perPage': 20 };
My class:
export class MyComponent implements OnInit { currentPage: number; pageSizes: number[]; perPage: number; constructor() { } ngOnInit(): void { { this.currentPage, this.perPage, this.pageSizes } = paginationConfig;
So, what I'm trying to do is destroy the object as examples in this book.
I can make it work if I use local variables, but in my case I really want them to be global. Is it impossible / not supported?
PS: I already tried to wrap everything in brackets, it also does not work.
source share