ui-view does not work for ui-tab. Please see the script, and kindly tell me where I am going wrong.
On the clients page, I call the client the page updates by clicking on any customer customers.view.html . This page contains a list of customers. When I click on any client, it opens a link, as shown in the following URL. http://localhost:3000/home/#/updatecustomer/5
customers.view.html
<a><i ui-sref="home.updatecustomer({ customerId: {{customer.id}} })" class="fa fa-edit pull-right" ng-click="$event.stopPropagation()"></i></a>
In config, I create the url http://localhost:3000/home/#/updatecustomer/5 , I can open the index.html page, but viewing the corresponding profile and setting does not open ...
See a similar working demo , Running DEMO
" CONFIG "
.state('home.updatecustomer', { url: 'updatecustomer/:customerId', views:{ '':{ templateUrl: 'addcustomer/index.html', controller: 'TabsDemoCtrl', }, 'profile':{ templateUrl: 'addcustomer/profile.html' }, 'setting':{ templateUrl: 'addcustomer/setting.html' }, } })
controller
var app = angular.module('app') ; app.controller('TabsDemoCtrl', TabsDemoCtrl); TabsDemoCtrl.$inject = ['$scope', '$state']; function TabsDemoCtrl($scope, $state){ $scope.tabs = [ { title:'profile', view:'profile', active:true }, { title:'setting', view:'setting', active:false } ]; }
index.html
<uib-tabset active="active"> <uib-tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disable="tab.disabled"> <div ui-view="{{tab.view}}"></div> </uib-tab> </uib-tabset>
profile.html
<div>profile of customer </div>
Setting.html
<div>Setting for customer </div>