tarlepp / angular-sailsjs-boilerplate

'Boilerplate' for AngularJS + Sails.js
MIT License
307 stars 87 forks source link

Problems to enable the profile.html #123

Open jjgonver opened 8 years ago

jjgonver commented 8 years ago

I'm trying to enable profile.html from the user link but I don't understand well the logic of UI router for that.

  1. In the root's frontend I created a folder profile with profile.html inside /frontend/profile/profile.html
<div class="row">
  <p>
    Profile html test
  </p>
</div>
  1. This is the code in app.js:
...
  // Routes that needs authenticated user
        $stateProvider
          .state('profile', {
            abstract: true,
            template: '<ui-view/>',
            data: {
              access: AccessLevels.user
            }
          })
          .state('profile.edit', {
            url: '/profile',
            templateUrl: '/frontend/profile/profile.html',
            controller: 'ProfileController'
          })
        ;
...
  1. This is the code in core\layout\partial\header.html
...
<li class="pull-right"
       data-ui-sref-active="active"
       data-ng-show="auth.isAuthenticated()"
>
       <a href="#" data-ui-sref="profile.edit">{{user().username}}</a>
       </li>
...

In that way no error but don't load anything. What am I doing wrong? Thanks