In my angular project , i have 4 components (comp1,comp2,comp3,comp4), i found a code of form (html , css & js ) and i wanna put it in comp1, so tell me if i'm right or not : do i put the html form code in comp1.component.html? and do i put the css and js codes in app.component.html or comp1.component.css & comp1.component.ts in order ?
I have added the html code in comp1.component.html, the css code in comp1.component.css and the script code in comp1.component.ts but there are some errors.
The error you are having is that you are trying to use JS code into TS file. If you put .js code into a .ts file you will have type errors.
Not quite sure about this, but you should have in mind that the component.css should contain only code that is going to use for that specific component. If not you can create a new .css file and import it into your project. Same logic for the rest of the files. If you are using angular versions from 2 to 16 have in mind that in your app.component.ts should contain only roots, imports, etc. The code you want to use for specific component should go to that specific component and never to the app.component.