how to preview the pdf in angular
Tuesday, 30 November 2021
pdf viewer in angular
[disabled]="chargeDetailsValues.chargeTypeDescription == 'GENERAL' "
disable in angular based on value bind
Saturday, 27 November 2021
select only year in date picker angular material
1.using angular material only year should select for this i have written this.
TS
openDatePicker(dp:any) {
dp.open();
}
closeDatePicker(D: any, dp ? : any) {debugger
// get month and year from eventData and close
datepicker, thus not allowing user to select date
dp.close();
var date = new Date(D);
var year = date.getFullYear();
alert(year);
}
}
HTML
<mat-form-field>
<input matInput [matDatepicker]="dp2" [(ngModel)]="tripInformations.productionYear"
name="productionYear" placeholder="Select a Date" (click)="openDatePicker(dp2)" />
<mat-datepicker-toggle matSuffix [for]="dp2"></mat-datepicker-toggle>
<mat-datepicker #dp2 startView="multi-year" (yearSelected)="closeDatePicker($event, dp2)"></mat-datepicker>
</mat-form-field>
date pipe
<input matInput type="text" placeholder="PU DATE"
[ngModel]="tripInformations.requiredDate | date:'yyyy-MM-dd'" (ngModelChange)="tripInformations.requiredDate = $event"
name="requiredDate" readonly />
Friday, 26 November 2021
reactive form validation
https://loiane.com/2017/08/angular-reactive-forms-trigger-validation-on-submit/
filter the array value
there are different methods to filter dupicates in an array
this.temp1.filter((v,i) => this.temp1.indexOf(v)===i);
Tuesday, 23 November 2021
dropdown dependencies
filter dropdown two based on one example
https://stackblitz.com/edit/flight-date-pikcer-ofkkme?file=src%2Fapp%2Fflight%2FairportPipe.ts
difference between dates dates
Thursday, 18 November 2021
separate alpha numeric
var result = "NewFolder333".match(/[^\d]+|\d+/g);
alert(result);
Output:Newfolder,333
Saturday, 13 November 2021
angular material popup issue
popup not closing after save
so then i given dialog ref inside component then its working fine
so
constructor(private dialogRef: MatDialogRef<MyDialogComponent>){ }
closeDialog(){
this.dialogRef.close();
}
popup issue
Friday, 5 November 2021
remove null and undefined and empty
1.from object key and value null remove from object is important
gatein after list edit old code
loadTransaction(transactionNo: string) {
this.gateInService.gettrucktransaction(transactionNo).subscribe((res: any) => {
if (res) {
console.log(res);
this.enableSizeValidation = false;
this.allDetails = res;
// this.dataSourceGateInSummary = res["truckItems"];
console.log (this.dataSourceGateInSummary.data)
this.validateSize();
let filterData = res.invoiceDetails.filter(i => i.sellingAmount != 0)
//handle later
let count =0;
for (let i = 0; i < filterData.length; i++) {
if(filterData[i].chargeCode==="GATE-E")
{
count++
if(count >1){
filterData.splice(i,1);
}
}
}
this.dataSourcePaymentDetails = filterData;
console.log(this.dataSourcePaymentDetails);
// this.dataSourcePaymentDetails.filter(i=>i.sellingAmount !=0)
this.sellingAmount = res["sellingAmount"];
this.vatAmount = res["vatAmount"];
this.nettAmount = res["nettAmount"];
this.whTaxAmount = res["whTaxAmount"];
this.invoiceNo = res["invoiceNo"];
this.sumOfMovements = res["truckItems"].length;
}
});
}
Subscribe to:
Posts (Atom)
c#
https://github.com/dcyuksel/Result
-
Points 1.complex page layouts and adherence to code standards. 2.primeNG pagination 3.ngcontent 4.ngdestory(memorylekage) 5.datatransfer wi...
-
Check duplicate count based on 3 columns combo select EMPID,FORMinfoID,FormName,Count(*) as counts from tbl_FilesMigrationLogs group by Em...