-1

in my file home.js have

.state('app.profile', {
    url : '/profile',
    views : {
        'appContent' : {
            templateUrl: '../templates/profile.html',
            controller: 'HomeController'
        }
    }
})

in my file profile.html have this

<ion-view title="Profile">
  <ion-content>
    <!--somethings here-->
  </ion-content>
</ion-view>

My directory

js
  home.js
templates
  profile.html

But I can't make it work. Please help me to fix this error!

halfer
  • 19,824
  • 17
  • 99
  • 186
Cấn Cát
  • 11
  • 1
  • 3
  • This old question doesn't seem to explain what the problem is/was, so I am voting to close. Do please edit if you can. – halfer Aug 09 '15 at 08:37

1 Answers1

0

If I understand you correctly, you must do so:

.state('index', {
    url : '/route1',
    templateUrl: '../templates/profile.html',
    controller: 'Controller'
})

if you want to use multiple views:

.state('index', {
    url: "/route1",
    views: {
      "viewA": { template: "index.viewA" },
      "viewB": { template: "index.viewB" }
    }
}) 
Arman Mukatov
  • 140
  • 1
  • 9
  • No no I mean that: I have this code in my index.html file But I want to separate them into 2 file. I copy main of – Cấn Cát Feb 08 '15 at 15:28