Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

How to use a child controller inside a abstract child state?

$
0
0

@luckyluke2012 wrote:

hey guys,
I am trying to build my first app, but I have a problem: All my controllers in the child state won't be called.
Here is my structure:
.config(function($stateProvider, $urlRouterProvider) {

$stateProvider

  .state('app', {
    url: '/app',
    abstract: true,
    templateUrl: 'templates/app.html',
    controller: 'DataCtrl'
  })

 .state('app.child1', {
   url: '/child1',
    views: {
      'appContent': {
            templateUrl: 'templates/child1.html',
            controller: 'Child1Ctrl'
    }
   }
 })
.state('app.child2', {
  url: '/child2',
   views: {
    'appContent': {
          templateUrl: 'templates/child2.html',
          controller: 'Child2Ctrl'
   }
  }
 })
  $urlRouterProvider.otherwise('/app/child1.html');
});

DataCtrl and Child1Ctrl will be called, but Child2Child will be not. Even if I try to put it into a different view.

Thank you in advance for your help!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>