Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public ngOnInit(): void {
this.localData = SINGERS;
this.toast.position = IgxToastPosition.Middle;
}
public ngOnInit() {
this.products = DATA.map(e => {
if (!e.UnitPrice) {
e.UnitPrice = 1;
}
e.Ordered = Math.floor(Math.random() * e.UnitsInStock);
return e;
});
this.toast.position = IgxToastPosition.Middle;
}
public showToast(toast, position) {
switch (position) {
case "middle":
this.toastPosition = IgxToastPosition.Middle;
break;
case "top":
this.toastPosition = IgxToastPosition.Top;
break;
default:
this.toastPosition = IgxToastPosition.Bottom;
}
toast.show();
}
}
{
email: "donnaprice@gmail.com",
id: "859-496-2817",
name: "Donna Price",
photo: "assets/images/women/50.jpg"
}
];
public tagList = [
{ id: "All Users", text: "All Users" },
{ id: "My Team", text: "My Team" },
{ id: "USA Team", text: "USA Team" },
{ id: "Engineering Services", text: "Engineering Services" }
];
public toastPosition: IgxToastPosition = IgxToastPosition.Middle;
@ViewChild("chipsAreaCc", { read: IgxChipsAreaComponent, static: true })
public chipsAreaCc: IgxChipsAreaComponent;
@ViewChild("ccGroup", { read: IgxInputDirective, static: true })
public ccGroup: IgxInputDirective;
@ViewChild("textArea", { read: ElementRef, static: true })
public textArea: ElementRef;
@ViewChild("chipsArea", { read: IgxChipsAreaComponent, static: true })
public chipsArea: IgxChipsAreaComponent;
@ViewChild("inputForm", { read: IgxInputDirective, static: true })
public inputBox: IgxInputDirective;
public transferData(source: IgxTreeGridComponent, target: IgxTreeGridComponent,
notification: IgxToastComponent) {
target.shouldGenerate = true;
target.clearCellSelection();
this.targetData = source.getSelectedData();
notification.message = `Transfered ${this.targetData.length} rows`;
notification.position = IgxToastPosition.Middle;
notification.displayTime = 1000;
notification.show();
}
public dataLoading(evt) {
if (this.prevRequest) {
this.prevRequest.unsubscribe();
}
this.loadingToast.message = "Loading Remote Data...";
this.loadingToast.position = IgxToastPosition.Middle;
this.loadingToast.autoHide = false;
this.loadingToast.show();
this.cdr.detectChanges();
this.prevRequest = this.remoteService.getData(
this.remoteCombo.virtualizationState,
null,
(data) => {
this.remoteCombo.totalItemCount = data["@odata.count"];
this.loadingToast.hide();
this.cdr.detectChanges();
});
}
public dataLoading(evt) {
if (this.prevRequest) {
this.prevRequest.unsubscribe();
}
this.loadingToast.message = "Loading Remote Data...";
this.loadingToast.position = IgxToastPosition.Middle;
this.loadingToast.autoHide = false;
this.loadingToast.show();
this.cdr.detectChanges();
this.prevRequest = this.remoteService.getData(
evt,
null,
(data) => {
this.remoteForDir.totalItemCount = data["@odata.count"];
this.loadingToast.hide();
this.cdr.detectChanges();
});
}
public transferData(source: IgxGridComponent, target: IgxGridComponent,
notification: IgxToastComponent) {
target.shouldGenerate = true;
target.clearCellSelection();
this.targetData = source.getSelectedData();
notification.message = `Transfered ${this.targetData.length} rows`;
notification.position = IgxToastPosition.Middle;
notification.displayTime = 1000;
notification.show();
}
public dataLoading(evt) {
if (this.prevRequest) {
this.prevRequest.unsubscribe();
}
this.loadingToast.message = "Loading Remote Data...";
this.loadingToast.position = IgxToastPosition.Middle;
this.loadingToast.autoHide = false;
this.loadingToast.show();
this.cdr.detectChanges();
this.prevRequest = this.remoteService.getData(this.combo2.virtualizationState, this.combo2.searchValue, () => {
this.combo2.triggerCheck();
this.loadingToast.hide();
this.cdr.detectChanges();
});
}