Skip to content

Instantly share code, notes, and snippets.

@masinamichele
Last active April 11, 2018 12:54
Show Gist options
  • Save masinamichele/6f6ffd23d5f9132623538c30810a7269 to your computer and use it in GitHub Desktop.
Save masinamichele/6f6ffd23d5f9132623538c30810a7269 to your computer and use it in GitHub Desktop.
import { Utils } from './../../shared/utils';
import { Costanti } from './../../shared/costanti';
import { MemoService } from './../../service/memo.service';
import {
Component,
Optional,
ElementRef,
OnInit,
Inject,
Input,
ChangeDetectionStrategy,
ViewEncapsulation,
OnDestroy
} from '@angular/core';
import { Memo } from './../../model/memo.model';
import { Masonry, MasonryGridItem } from 'ng-masonry-grid'; // import necessary datatype
@Component({
selector: 'app-memo',
templateUrl: 'memo.component.html',
styleUrls: ['memo.component.css', '../../../../node_modules/ng-masonry-grid/ng-masonry-grid.css'],
providers: [MemoService]
})
export class MemoComponent implements OnInit, OnDestroy {
showMasonry = true;
note = [];
_masonry: Masonry;
target: any;
onNgMasonryInit($event: Masonry) {
this._masonry = $event;
}
ngOnInit() {
Utils.ClearStorageKey();
this.getListaMemo();
}
noteCaricate = false;
getListaMemo() {
this.memoService.lista().subscribe(
data => {
this.note.splice(0);
this.note = data.slice();
setTimeout(() => {
this.noteCaricate = true;
}, 1000);
},
err => {
console.log(err);
}
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment