TypeScript- s Angular Framework Error - There is no directive with exportAs set to ngForm

0 votes

When I use TypeScript's Angular2-forms framework I keep getting this error:

There is no directive with "exportAs" set to "ngForm"

Project dependencies :

  "dependencies": {

    "@angular/common": "2.0.0-rc.6",

    "@angular/compiler": "2.0.0-rc.6",

    "@angular/core": "2.0.0-rc.6",

    "@angular/forms": "2.0.0-rc.6",

    "@angular/http": "2.0.0-rc.6",

    "@angular/platform-browser": "2.0.0-rc.6",

    "@angular/platform-browser-dynamic": "2.0.0-rc.6",

    "@angular/router": "3.0.0-rc.2",

    "ng2-bootstrap": "^1.1.1",

    "reflect-metadata": "^0.1.8",

    "core-js": "^2.4.0",

    "es6-module-loader": "^0.17.8",

    "rxjs": "5.0.0-beta.11",

    "systemjs": "0.19.27",

    "zone.js": "0.6.17",

    "jquery": "3.0.0",

  }

Login Template :

<form #loginForm="ngForm" (ng-submit)="authenticate(loginForm.value)">

</form>

Login Component :

import { Component } from '@angular/core';

import {Http, Headers} from '@angular/http';

@Component({

    moduleId: module.id,

    selector: 'login-cmp',

    templateUrl: 'login.component.html'

})

export class LoginComponent {

  constructor($http: Http) {

    this.$http = $http;

  }

  authenticate(data) {

   ... 

  }

}

Error :

zone.js?1474211973422:484 Unhandled Promise rejection: Template parse errors:    

There is no directive with "exportAs" set to "ngForm" ("

            <form [ERROR ->]#loginForm="ngForm" 

(ngsubmit)="authenticate(loginForm.value)">

Can someone help me with this issue?

May 23, 2022 in Angular by Kichu
• 19,050 points
1,398 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Angular

0 votes
1 answer

How to make FileReader work with Angular?

Hello @kartik, First you have to specify the ...READ MORE

answered Sep 8, 2020 in Angular by Niroj
• 82,840 points
18,608 views
0 votes
1 answer

What is shared scope(in Directive)?

Assuming that you have knowledge on Scope( ...READ MORE

answered Feb 4, 2020 in Angular by Niroj
• 82,840 points
484 views
0 votes
1 answer

What is inherited/child scope in directive?

Hey kartik, As you use the term inheritance ...READ MORE

answered Feb 5, 2020 in Angular by Niroj
• 82,840 points
544 views
0 votes
1 answer

What is the difference between Call back transclusion function and no call back transclusion function?

Hey,    There is no difference between clone linking and ...READ MORE

answered Feb 5, 2020 in Angular by Niroj
• 82,840 points
242 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Can't bind to 'formGroup' since it isn't a known property of 'form'

In order to rectify this error, you ...READ MORE

answered Feb 10, 2022 in Others by Rahul
• 9,670 points
6,211 views
0 votes
1 answer

How to apply zoom animation for each element of a list in angular?

Hey @Sid, do check if this link ...READ MORE

answered Jul 30, 2019 in Others by Vardhan
• 13,200 points
691 views
0 votes
1 answer
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 52,760 points
1,275 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP