Hi there!
I'm an experienced C# developer but I'm really struggling to learn Angular4
and I'd really appreciate some help, please.
I'm using Visual Studio 2017 Community Edition to make an ASP NET Core MVC
API application with an Angular4 front-end, starting from the
out-of-the-box template that has a HomeComponent, CounterComponent and
FetchDataComponent. I'm afraid I have broken something and I don't know how
to fix it.
My trouble is that, when I debug the application from Visual Studio using
Chrome browser, Angular seems to be ignoring any changes that I made to my
source files - it's as if it's serving up the original template application
instead of the one I edited. For example:
I changed "Hello, World!" to "Hello, Cruel World!" in my
*home.component.html* and debug, but the change isn't reflected.
So then I tried changing *app.routing.ts* so that it should load a
completely different component when the app is started. I changed:
* { path: '', component: HomeComponent }*
To
* { path: '', component: CounterComponent }*
But when I debug, it still loads the *HomeComponent*. Next I renamed
*HomeComponent *to *HoomeCompoonent *so it should be 100% impossible for
the app to work now. It should be totally broken but it isn't. It
stubbornly loads the *HomeComponent* exactly the same as how it looked
before I started. It's as if nothing I do makes a difference.
I have deleted the bin, and obj folders before rebuilding, in case Visual
Studio was caching a previous version of the app, but it still serves the
original Angular site instead of my updated one.
I have a suspicion that it's something to do with *wwwroot*. I guess maybe
Visual Studio is supposed to update some files in *wwwroot *when the
Angular app is changed, and maybe it isn't doing that?
I decided to do a search for the text "Hello, World" in my *wwwroot *folder
and found it in a very long, complex file called *main-client.js *in
*wwwroot/dist* I thought this could be the place where the old version is
being cached. I deleted the file, and managed to break the site. I got an
error in the Chrome developer window that it couldn't find the file.
Do I have to learn to edit the *main-client.js* file, or is that file
supposed to be auto-generated by Visual Studio? How do I make the file
update when I change my Angular components? Or am I on the wrong track
completely?
Appreciate any advice. Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.