angularjs - Angular ui router - Share views between states -


I'm trying to create a web app where I have an index.html page with three ideas: headers, Content and footer.

I want to be consistent between the header and footer pages, but not the same as part of the index.html file.

I would also like the content

index.html

   

app.js

  $ stateProvider .state ('my-app', {abstract: true, view: { 'Template': {templateUrl: 'partials / shared / footer.html'}}}) .state ('my- App.home ', {url: "/", View: {' Content ': {templateUrl:' partial / home_ ', Controller:' Home Controller '}}})  

If I load the page "/" then it shows the header and footer loading properly, and I can see them on the page, but the main content is unavailable.

Can anyone tell me what I am doing wrong?

Thank you

I managed to understand it.

To see me in the state of your child was to get the viewpoint clearly in the original situation.

To do this, I had to pay attention to the 'content @'.

Fixed code:

app.js

  $ stateProvider .state ('my-app', {abstract) : Truth, Thoughts: {'Header': {templateUrl: 'partials / shared / header.html', Controller: "Usercontroller"}, 'Pastor': {templateUrl: 'partials / shared / footer.html'}}}) .state ('my-app.home', {url: "/", view: {'content @': {TemplateHTML: 'partial / home_', controller: 'home controller'}}})  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -