angularjs - html partial is not loaded into ui-view -


I posted a sample on plunker:

I got an error Not found in your browser console.

I want to see when I see the view of the day / week / month by pressing the button under the button

The reason for this is that the day, week And the controller of the month can not be hit in the code, so why not.

So my question is why the controllers have not been loaded or replaced ui-view with the actual HTML partial.

I do not know the real reason why I have to ask for both matters.

  'Strict use'; Angular Rune (['$ Rootscope', '$ State', '$ State Parameters', Function ($ Rootscope, $ State, $ Statapm) {$ Rootscope $ State = $ State; $ rootScope. $ StateParams = $ stateParams;}] {function ($ state provider, $ urlRouterProvider) {$ urlRouterProvider. Otherwise ('/ dateplanner / day'); $ stateProvider .state ('date', { Url: '/ dateplanner', abstract: true, idea: {'menu @': {templateUrl: 'menu.html'}, 'content @': {templateUrl: 'dateplanner.html', controller: 'datekeeper controller'} }} .state ('dates.day', {url: '/ day', thoughts: {'Planner @': {templateUrl: 'dateplannerday.html' , Controller: 'DateplannerDayController'}}}) .state ('Dates.week', {url: '/ week', view: {'Planner @': {TemplateUrl: 'dateplanner.week.html', Controller: 'DateplannerWeekController '}}}) .state (' dates.month ', {url:' / month ', view: {' Planner @ ': {templateUrl:' dateplanner .month.html ', Controller:' DateplannerMonthController '}}}) });  

MENU.HTML

  & lt; Ul & gt; & Lt; Li ng-class = "{activeButton: $ state.includes ('date')}" ui-sref-active = "active" & gt; & Lt; A ui-sref = "dates.day" & gt; Date Planner & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

DATEPLANNER.HTML

  & lt; Div class = "btn-group" & gt; & Lt; Button ui-sref = "dates.day" ui-sref-active = "btn-primary" type = "button" class = "btn btn-default" & gt; Day & lt; / Button & gt; & Lt; Button ui-sref = "dates.week" ui-sref-active = "btn-primary" type = "button" class = "btn btn-default" & gt; Week and lieutenant; / Button & gt; & Lt; Button ui-sref = "dates.month" ui-sref-active = "btn-primary" type = "button" class = "btn btn-default" & gt; Month & lt; / Button & gt; & Lt; / Div & gt; & Lt; Div style = "background: white;" Ui-view = "planner" & gt; Loading ... for & lt; / Div & gt; As we discussed this here:  

  • relates to this problem:

    • In our case, we raise it to the correct Children's states (day, week, month) have their visual names to target the full visual name goal:

        .state ('dates.day', {url: '/ day ', Thoughts: {' Planner @ Dates': {.}}}} .state ('dates.week', {url: '/ week', view: {'Planner @ dates': {...} }}) .state ('dates.month', {Url: '/ month', view A: {'Planner @ Dates': {...}}  

      Because these ideas are in the target state adding name after the delimiter @ Besides, 'Planner @ Dates', that is, because this state is the mother of all of them, we can leave it. Parents' position is behind us for injection ui-router.More clarifications: / P>

      Behind the scenes, each scene is given a fixed name that is vi Ewname @ statename , where the name of the name name is the visual name and the state name is the full name of the state, such as contact.item N. Write your sentence in complete syntax Also chooses the option of.

      Quick view

      1. placed in ui-view = "content" index.html Absolute name "Content @" is the delimiter @ and the state route is represented as "" (string blank). To wit. viewname @ statename === `'content @"

      2. Target the children's parents as "Planner @ Dates" or "Planner" They can also target the original like "content @"


  • Comments

    Popular posts from this blog

    sqlite3 - UPDATE a table from the SELECT of another one -

    c# - Showing a SelectedItem's Property -

    javascript - Render HTML after each iteration in loop -