-
Notifications
You must be signed in to change notification settings - Fork 433
Issues with Styles approach in ngAspnetCoreEngine #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It'll be adding in the upcoming 5.0 release (as it's waiting to be merged in there, there were many updates for 5.0) 5.0 PR here: Universal aspnetcore-engine PR here: |
That's great! Any update on migrating this repo to Angular 5, since Angular 5 is now in RC. |
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
Jan 17, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
May 15, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
May 15, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to Hunter-Industries/aspnetcore-angular2-universal
that referenced
this issue
May 16, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
Jun 8, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
Jun 8, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
Jun 8, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
BillSheldon-HunterIndustries
pushed a commit
to BillSheldon-HunterIndustries/aspnetcore-angular2-universal
that referenced
this issue
Jun 8, 2018
…IO#437) * feat(5.0): update engine-etc for angular 5.0-rc1 WIP - More updates to come * remove ng 4 references * update source maps for faster HMR builds * use aspnetcore-engine & misc updates and fixes * update to 5.0 official Closes TrilonIO#434 Closes TrilonIO#435 Closes TrilonIO#430 Closes TrilonIO#424
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using
Angular 4.4.3
, andangular/material 2.0.0-beta.11
andngAspnetCoreEngine
form this repository in one of my projects. There is a slight difference the way I am settingtitle
andcanonical tags
in my app. Since majority of the pages in my case are dynamic and both title and canonical tags are dynamic as well. Therefore instead of setting title and links from App component on (router change subscription) I set title and links from the component corresponding to the page. For title I am using Title service from Angular and for Links I am using Links server from this repo.Today when I inspected the generated markup of few pages of my app. I found duplicate title and canonical tags.
I did some research and found that the issue is due to the way
ngAspnetCoreEngine
fetches the styles:Since I am using Material it appends several
style
tags to theHead
element, each tag containing styles related to specific component or group of components. Now when I add Title from my component its not always the first element after<head>
tag. Sometimes its after few styles tags, followed by few other style tags.Although using the above approach, selects all style tags but it also select the title and meta tags if they fall in between style tags. As a result the final markup which is sent from the server to the browser contains multiple Title tags. One form globals.title and other from the globals.styles.
There is some code in ngAspnetCoreEngine, but its commented
I uncommented the above code in ngAspnetCoreEngine and updated the resolve statement to the following:
And it started working perfectly.
Based on above, I think the styles approach in current ngAspnetCoreEngine requires an update. There is a comment in above code which says
// Broken after 4.0 (worked in rc)
I am not sure what exactly is broken, its working perfectly fine withAngular 4.4.3
.The text was updated successfully, but these errors were encountered: