Daniel Kobe
Daniel Kobe

Reputation: 9825

uiRouter ui-view is not populated by nested state templates

I'm trying to have two different templates loaded into a ui-view, depending on the state. The problem is that when I go to either of the states (coupon.form and coupons.login) neither of them populate coupon's ui-view. What am I doing wrong?

uiRouter Code

angular.module('couponGeneratorApp')
  .config(function ($stateProvider) {
    $stateProvider
      .state('coupons', {
        abstract: true,
        url: '/generate-coupons',
        template: '</ui-view>'
      })
      .state('coupons.form', {
        url: '',
        template: '<h1> HELLO FORM </h1>'
      })
      .state('coupons.login', {
        url: '',
        template: '<h1> HELLO LOGIN</h1>'
      });
  });

Upvotes: 0

Views: 136

Answers (1)

Eric Wei
Eric Wei

Reputation: 146

The template in the 'coupons' state should be '<ui-view />', not '</ui-view>'

Upvotes: 1

Related Questions