Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Please update Angular template to Angular CLI 6 #1637

Closed
naveedahmed1 opened this issue May 4, 2018 · 12 comments
Closed

Please update Angular template to Angular CLI 6 #1637

naveedahmed1 opened this issue May 4, 2018 · 12 comments

Comments

@naveedahmed1
Copy link

Since Angular 6 and Angular CLI 6 has been released it would be great if you could please update this template to Angular CLI 6.

@dballemo
Copy link

dballemo commented May 6, 2018

There is an alternative solution for UseAngularCliServer or UseProxyToSpaDevelopmentServer (template net core 2.0) to start with angular.json (old ".angular-cli")?. WDS does not refresh change in template or logic (ts).

@alx-andru
Copy link

@dballemo can you elaborate more?

@dballemo
Copy link

dballemo commented May 6, 2018

After updating package.json with Angular 6.0.0 and migrating from ".angular-cli.json" to "angular.json", the template starts with UseProxyToSpaDevelopmentServer but the changes in html and ts are not refresh (Wds) changes in browser Chrome . Requires start project again.

@naveedahmed1
Copy link
Author

@SteveSandersonMS since angular/angular-cli#8616 should be merged soon it would be better that this update has SSR enabled by default.

@tomgruszowski
Copy link

@naveedahmed1 SSR by default? Not sure I agree. This isn't exactly a trivial feature that 'just works'. One should probably understand the implications before turning this on, even current docs have big warning blobs of text.

@changhuixu
Copy link

Please don't enable SSR by default. For web apps behind firewalls, SSR is not essential.

@SteveSandersonMS
Copy link
Member

Just for anyone who's interested, we're not planning to enable SSR by default. It's not beneficial in a lot of cases, and adds complexity. So we intend to keep it an optional feature with docs about how to enable it and work within its constraints.

@naveedahmed1
Copy link
Author

Ok makes sense. Can you please update the docs to show how to return proper status code such as 404 in SSR section?

Can you please also share the download link for the pre release updated template once it's completed?

Thank you for the awesome work 👍

@djarekg
Copy link

djarekg commented May 9, 2018

Does anyone know why JavascriptServices doesn't work with angular6? Is there a work around to get this working?

@SteveSandersonMS
Copy link
Member

We're working on the update at aspnet/Templating#515

@simeyla
Copy link

simeyla commented Jun 25, 2018

To get a clean project with Angular 6 :

  • Wipe out the contents of ClientApp that this template creates - or if you're planning on referring to the sample code just rename it or put it elsewhere
  • Run ng new with the options you want
  • Copy into ClientApp the files created by ng new
  • Note ng new will create a subdirectory. Copy everything a level up so ClientApp has the same structure as before (apart from the changes like angular.json).

The rest of the template will work just fine, but this will get you up and running with a clean slate of the latest ng bits.

@tonywr71
Copy link

simeyla did you get the Publish to work after doing that? Publish doesn't work for me when you do that. To test, right-click on your project, Properties -> Debug and change your ASPNETCORE_ENVIRONMENT variable to Production then run. Site should fail with:
"Error.
An error occurred while processing your request.
Request ID: 0HLF7GTE6V8F0:00000001

Development Mode
Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application."

In the Output window it shows "The SPA default page middleware could not return the default page '/index.html' because it was not found, and no other middleware handled the request.
Your application is running in Production mode, so make sure it has been published, or that you have built your SPA manually. Alternatively you may wish to switch to the Development environment."

Not sure how to fix this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants