Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message when the form for ngFormModel is undefined is poor. #8136

Closed
escardin opened this issue Apr 19, 2016 · 1 comment
Closed

Error message when the form for ngFormModel is undefined is poor. #8136

escardin opened this issue Apr 19, 2016 · 1 comment
Assignees

Comments

@escardin
Copy link

Steps to reproduce and a minimal demo of the problem
When a form is not provided to ngFormModel, the console error message does not describe the root cause. See plunk: http://plnkr.co/edit/Oyj4mq7C9e88AfsXr4M1?p=preview

What steps should we try in your demo to see the problem?
The issue is demonstrated on load. When you uncomment lines 34-36 of app.ts the failure goes away, indicating the cause is a missing form.
Current behavior

RIGINAL EXCEPTION: TypeError: Cannot read property 'validator' of undefinedBrowserDomAdapter.logError @ angular2.dev.js:23501
angular2.dev.js:23501 ORIGINAL STACKTRACE:BrowserDomAdapter.logError @ angular2.dev.js:23501
angular2.dev.js:23501 TypeError: Cannot read property 'validator' of undefined
    at NgFormModel.ngOnChanges (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:16731:73)
    at AbstractChangeDetector.ChangeDetector_App_0.detectChangesInRecordsInternal (viewFactory_App:45:59)
    at AbstractChangeDetector.detectChangesInRecords (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:8077:14)
    at AbstractChangeDetector.runDetectChanges (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:8060:12)
    at AbstractChangeDetector._detectChangesInViewChildren (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:8139:14)
    at AbstractChangeDetector.runDetectChanges (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:8064:12)
    at AbstractChangeDetector.detectChanges (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:8049:12)
    at ChangeDetectorRef_.detectChanges (https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:5180:16)
    at https://code.angularjs.org/2.0.0-beta.8/angular2.dev.js:12682:27
    at Array.forEach (native)

Expected/desired behavior
A message indicating that no form was passed. Perhaps: 'ngFormModel is missing a form'

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants