Posts

Showing posts from July, 2017

There is no directive with "exportAs" set to "ngForm" in Angular 2.0 or 4.0

Error got is : There is no directive with "exportAs" set to "ngForm"  for below html. <div class="container">     <form #ProdForm="ngForm" (ngSubmit)="onSubmit($event)" autocomplete="off">         <div class="form-horizontal">             <h3> Product Form</h3>             <div class="form-group">                 <label for="inputText" class="control-label col-xs-2">Number</label>                 <div class="col-xs-10">                     <input type="number" class="form-control" id="txtCustomerName" placeholder="Product Number" required [(ngModel)]="editProduct.id">                 </div>             </div>             <div class="form-group">                 <label for="inputText" class="control-label col-xs

Angular 2.0/4.0 Configuration in Visual Studio

Image
Angular 2.0/4.0 Setup in Visual Studio Step 1:   Install node.js & TypeScript                 For checking node.js is installed in command prompt use “node -v” or “node --version”(space before -)                 For checking TypeScript is installed in command prompt use “tsc  -v” Step 2: Open latest version of Visual Studio                 Select File->project Step 3: Under Templates select web option as seen below image. Change project name as you required & press OK button Step 4: Select MVC project& select OK Step 5:  Download Sample From angular.io Ref https://angular.io/docs/ts/latest/guide/setup.html#!#download 1. Open VS NewProject ->select MVC template. Now add below files to root  Systemjs.config.js  Tsconfig.json  Packages.json Step 6 : Project -> Rt click -> new folder {app} In app folder add  Main.ts  App.module.ts  App.component.ts Step 7: Now in index.html page copy the scrip