How to use FormsModule in modules other than app module?


Shubagit Halder

I am trying to add FormsModule in myform.module.ts but it is not working and showing me this error.

 error NG8003: No directive found with exportAs 'ngForm'

What I have done so far:

myform.module.ts

myform.module.ts

This is the HTML file.

enter image description here

When I do the same on app.module.ts it works fine. But not in any other modules I've created.

I've tried every possible way I can find on google but nothing works. My angular version is 12.

Faisal

You need to export FormsModule:

exports: [
  FormsModule
]

Related


How to use a module other than "GOPATH" in another module?

Samadadi: I have created a module library for personal use outside of "GOPATH" in the "database" folder using the following command "go mod init database", but I don't know: How can I use/ import this module in other modules? OS: Windows 7 , Go: v1.11 icza : T

How to use a module other than "GOPATH" in another module?

Samadadi: I have created a module library for personal use outside of "GOPATH" in the "database" folder using the following command "go mod init database", but I don't know: How can I use/ import this module in other modules? OS: Windows 7 , Go: v1.11 icza : T

How to use a module other than "GOPATH" in another module?

Samadadi: I have created a module library for personal use outside of "GOPATH" in the "database" folder using the following command "go mod init database", but I don't know: How can I use/ import this module in other modules? OS: Windows 7 , Go: v1.11 icza : T

How to call/use this module in other JS files/modules

purple cat I recently read some JS module design patterns. I came across this small code snippet as shown below. (function(window) { var Module = { data: "I'm happy now!" }; window.Module = Module; })(window); Still don't know much about

How to call/use this module in other JS files/modules

purple cat I recently read some JS module design patterns. I came across this small code snippet as shown below. (function(window) { var Module = { data: "I'm happy now!" }; window.Module = Module; })(window); Still don't know much about

How to call/use this module in other JS files/modules

purple cat I recently read some JS module design patterns. I came across this small code snippet as shown below. (function(window) { var Module = { data: "I'm happy now!" }; window.Module = Module; })(window); Still don't know much about

How to call/use this module in other JS files/modules

purple cat I recently read some JS module design patterns. I came across this small code snippet as shown below. (function(window) { var Module = { data: "I'm happy now!" }; window.Module = Module; })(window); Still don't know much about

How should I access other modules in a module?

seltown I'm struggling with the "global" aspect of module-related functions. Maybe someone can tell me if this example works, explain why, and then tell me the right way. If I have two modules: f1.lua local mod = T{} function mod.print_msg(msg) print(msg)

How to make a module accessible to other modules

password I have two files 'mod1.py' and 'mod2.py' . mod1 requires the requests module to run. But instead of importing them into mod1, I imported both the requests and mod1 modules into mod2 . but I get an error "The name 'requests' is not defined" . I know th