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

Angular 1.5 Components and Tabs

$
0
0

@dtime35 wrote:

So I am using Ionic 1 with AngularJS 1.5+ to allow use of components. For the most part this is working great but there is one issue I am having. I have two tabs at the moment, the first tab is loading everything fine but when I click on the second tab, it loads the state but never the component/template. I am wondering if anyone has any insights. Just to reiterate, the tabs and home components are loading fine in the below code.

App Config:

(function () {
  'use strict';
  angular.module('app').config(['$ionicConfigProvider', '$stateProvider', '$urlRouterProvider', 'globalConfigProvider', function ($ionicConfigProvider, $stateProvider, $urlRouterProvider, globalConfigProvider) {
    $ionicConfigProvider.tabs.position('bottom');

    $stateProvider.state('tabs', {
      url: '/tabs',
      abstract: true,
      views:{
        'tabs': {
          template: '<tabs></tabs>'
        }
      }
    }).state('tabs.home', {
      url: '/home',
      views: {
        'tab-home': {
          template: '<home></home>'
        }
      }
    }).state('tabs.options', {
      url: '/options',
      views: {
        'tab-options': {
          template: '<gorn-options></gorn-options>'
        }
      }
    });

    $urlRouterProvider.otherwise('/tabs/home');
  }]);
})();

Component: (Same for home except the name and home is working fine)

(function () {
  'use strict';
  angular.module('app').component('gorn-options', {
    selector: 'gorn-options',
    bindings: {},
    controller: function () {
      console.info("Gorn options loaded");
    },
    controllerAs: 'gorn-options',
    templateUrl: 'views/pages/gorn-options/gorn-options.html'
  });
})();

Posts: 5

Participants: 2

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>