Write scalable JavaScript with static types. Learn TS syntax, generics, unions, narrowing, decorators, modules, build tooling, and tsconfig. Improve DX, refactoring safety, and API design across Node.js and frontend frameworks with practical examples.
626 posts185 contributors
I get an error when learning Angular.“has no exported member 'Observable'” Ask
ERROR Error: Uncaught (in promise): TypeError: _this._driver.validateStyleProperty is not a function
error trying to diff 'response with status 200 ok for url only arrays and iterables are allowed
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
TypeError: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable.throw is not a function
Angular 5 - how to use the component without model properties
Hi i have a save funtion in my angular app.if save is failed i need to show error message that returning from api.what i tried is.. in my service; private handleError(error: Response) { return Observable. throw (error.text()); } save(id: any) { .map(res => < string []>res.json()) . catch ( this .handleError); } component.ts: save() { this .Service.save( this .id) .subscribe(response => { this .res= response; }, (error) => { <
ERROR Error: Found the synthetic property @flyInOut. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
Hi i have a dropdown having values id and value.On the click event i need to use both id and value .now i am passing id only in ngmodel.how can i pass the object in ngmodel..so i can use in ts like object.id,and object.value please help this s my dropdown <select class="styled-select" [(ngModel)]="id" (change)="onSelectYear($event.target.value)"> <option [ngValue]="select" disabled [selected]="true">--Select Model Year--</option> <option *ngFor="let code of year " value={{code.id}}>{{code.value}}</option> </select> in ts file i shud get like onSelectYear(obj: any) { obj.id= obj.value= }
Hi i have two components A&B. In A i am having a dropdown which contains car models.In B i am having one more dropdown contain model year.If I am selecting a car from dropdown A the available year associated with that selected car will display.All are working fine but im facing one issue that from B if i am changing any particular year A component not refreshing immediatly .Aftr page reload only am getting the new values.How i can solve this.Ngonint call is not a good way because i am having enough methodes inside that?please help
hi, I want to filter some details by start date and end date PS: i have array in component contains details and start date and end date i created this pipe but it doesn't work how to do please and thanks in advance import { Pipe, PipeTransform } from '@angular/core'; import { DatePipe } from '@angular/common'; @Pipe({ name: 'dateFormatPipe', }) export class dateFormatPipe implements PipeTransform { transform(projetList:any,value1: string,value2: string) { if (projetList && projetList.length) { var datePipe = new
Error: The selector "ng-component" did not match any elements
Hi, Can anyone tell me which automation testing tool is more mature in the industry for Angular application?
in my data table(using PrimeNg for angular 2)i have a coloumn name Ispublished.If Ispublishd is true need to disable the editbutton and change the color of the row.. how i can achive it? <p-dataTable [value]="weightsegment" resizableColumns="true" selectionMode="single" [(selection)]="selectedCar" [responsive]="true" [rows]="4" [paginator]="true" #dt> <p-column field="isPublished" header="isPublished " [sortable]="false"></p-column> <p-column field="CreatedBy" header="CreatedBy" [sortable]="false" [filter]="false" filterPlaceholder="Search"></p-column> <p-column field="CreatedOn" header="CreatedOn " [sortable]="false" [style]="{'width':'200px'}" [filter]="false" filterPlaceholder="Search"> <ng-template let-row="rowData" pTemplate="body"> {{row.CreatedOn | date}} </ng-template> </p-column> <p-column field="UpdatedBy" header="UpdatedBy " [sortable]="false" [filter]="false" filterPlaceholder="Search"></p-column> <p-column field="UpdatedOn" header="UpdatedOn" [sortable]="false" [style]="{'width':'200px'}" [filter]="false" filterPlaceholder="Search"> <ng-template let-row="rowData" pTemplate="body"> {{row.UpdatedOn | date}} </ng-template> </p-column> <p-column header="Edit"> <di
If we want to convert .ts file into .js then NodeJS should be installed in system?
How we can get the MAC address of a machine using Java Script or Type Script.
How to use single lazy loading module with all components.ts files and how to make single lazy module to all application components without include login component.
In this post, I'm going to share how to compile TypeScript files automatically.
Hi i am having a json object and an arraylist inside it this.cars = [ { "carOwner": "foo", "carList": [ { "Name": "honda", "value": 2000 }, { "Name": "bmw", "value": 4440 } ] } ]; i have to bind name and value how can i bind array in an object
hi, I have an arrow which I want when the user selects a book after he clicks the arrow I show him the details of the book in angular 2+ how to do it please And thank you in advance
Enums in TypeScript is basically collection of named constants which is used to create unique class