Reputation: 1185
I am developing my first ASP.NET Core application with Angular 2.
The application must have individual user access. Since there is no template in Visual Studio 2017 for Angular applications I generated an Angular project in Powershell with Yoman, opened it in another Visual Studio and copied all the Angular files and folders into my normal Visual Studio project which has the individual user access template generated.
I was able to make Angular work in my project. The three default pages generated by Yoman appear and work. The second one is a page with an increment button and variable. The problem is that if I change the increment in the "counter.component.ts" from this.currentCount++; to this.currentCount+=3; for example, the change is not reflected in the main-client.js file in the dist folder.
I have added the Target lines in the .csproj file and I do not know how to proceed.
What other options are there?
This is what I have https://1drv.ms/u/s!AvPiv6aM2fzRepKV9J_F0-387Zc
I have added "compileOnSave": true and it still doesn't work
Thank you very much for your help!
Upvotes: 0
Views: 263
Reputation: 1185
This is really dumb, but for anyone else that might come to this step, what I was missing was to build the Angular packages in "Startup.cs" (of course)
In Configure method, in the
if (env.IsDevelopment())
these lines:
app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions
{
HotModuleReplacement = true
});
and in
app.UseMvc(routes =>
these lines
routes.MapSpaFallbackRoute(
name: "spa-fallback",
defaults: new { controller = "Home", action = "Index" });
Upvotes: 1