Angular2TypeScriptASPNETCoreWebApp
Angular2TypeScriptASPNETCoreWebApp copied to clipboard
Cannot use templateUrl parameter in component
As far as I can tell, there is something wrong with the build environment in the project that prevents templateUrl from working. The component's html file is not found (404). See this SO post for more details.
Sorry for the delay, I'm kind of busy these days. I'll check this ASAP. Thank's for reporting.
I've juste quickly look at it and I don't understand your issue. I've add a new component with an HTML file and it's working. You can see a templateUrl working in the AboutComponent, the view is here.
Can you give me more details about the issue you are dealing with ?
https://github.com/AdrienTorris/Angular2TypeScriptASPNETCoreWebApp/commit/014ae1428f9f5e9a045e5028b6968286e526f329
I post an answer on Stack Overflow. I think you forgot to declare your new component in the application module. Can you keep me updated ? Sorry for the delay again ...
I have a sample error and i already wrote it on AppModule and Routing
I get the same problem. Part of my component is below @Component({ selector: 'app-server', // template: '
The server component for me
' templateUrl: './server.component.html' }) The above does not work but when I comment out the templateUrl line and remove the in line template comments, the code works and the HTML is displayed. The app.module.ts is set up correctly. The in line template would not work otherwise.
@CMode11 Is your project visible somewhere ? On GitHub ?
@CMode11 Note that the templateUrl is refering to the build directory (outDir parameter in your tsconfig file), so your html file has to be there
Hi Adrien, I just posted my project to https://github.com/CMode11/ang4VS Still cant solve problem. Hope you can find it. Im sure its something simple. I just wanted a simple component with templateUrl accessing a html file
Windows crashed twice during your zip's extraction. I can't see the file in there.
@CMode11 If you put your projet on the GitHub source control in a classic way (without a zip but with the files directly in GitHub), I could take a look if you want.