angular-sailsjs-boilerplate icon indicating copy to clipboard operation
angular-sailsjs-boilerplate copied to clipboard

Problems to enable the profile.html

Open jjgonver opened this issue 8 years ago • 0 comments

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

jjgonver avatar Apr 10 '16 10:04 jjgonver