SPFxAngularCLI icon indicating copy to clipboard operation
SPFxAngularCLI copied to clipboard

ngModel and angular forms is not working.

Open shailesh-sangekar opened this issue 6 years ago • 4 comments

I added the simple registration form in the cloned application. I want to add a simple form with some validations (with angular forms), but no message was displayed on the screen. I have added logs in the validation method and logs are displayed properly. I tried second option to show and hide the label on validation failed method still no luck. Can you suggest any modification in solution for this?

shailesh-sangekar avatar Jul 09 '18 14:07 shailesh-sangekar

Have you tried adding them in a simple Angular CLI project - are you using exactly the same steps? What steps did you follow?

maliksahil avatar Oct 17 '18 17:10 maliksahil

Thanks, Sahil for your response.

I followed the steps you mentioned in the article. The clone web part with view data was working perfectly on the same project then, I modified it with input text controls and label controls to achieve two-way binding. On the first load, it modifies data on the screen (UI) but later any changes from the screen (UI) are not reflecting on the associated model.

shailesh-sangekar avatar Oct 22 '18 09:10 shailesh-sangekar

I have the same Problem. Somehow the Binding is deactivated. I think it has to be something with: platformBrowserDynamic().bootstrapModuleFactory( AppModuleNgFactory, { ngZone: 'noop' })

N3uR02812 avatar Feb 13 '19 10:02 N3uR02812

As i expected. You have to remove { ngZone: 'noop' } complete, than in the imports you need: import 'zone.js';

Now it works for me

N3uR02812 avatar Feb 13 '19 15:02 N3uR02812