Köşeli bir öğrenme yapıyorum ve bir HTML dosya parçasını dinamik olarak bir sekmenin içerik bölmesine yüklemeye çalışıyorum.UI önyükleme durumları ui-bootstrap sekmelerinin içeriğine nasıl yüklenir
this linked plunker ben devletleri
var app = angular.module('Plunker', ['ui.router', 'ui.bootstrap'])
app.config([
'$stateProvider',
'$urlRouterProvider',
function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state("tab1", { url: "/tab1", templateUrl: "tab1.html" })
.state("tab2", { url: "/tab2", templateUrl: "tab2.html" })
.state("tab3", { url: "/tab3", templateUrl: "tab3.html" });
$urlRouterProvider.otherwise('/');
}]);
app.controller("tabsController", function ($rootScope, $scope, $state) {
$scope.tabs = [
{ title: "My Tab 1", route: "tab1", active: true },
{ title: "My Tab 2", route: "tab2", active: false },
{ title: "My Tab 3", route: "tab3", active: false },
];
$scope.go = function (route) {
$state.go(route);
};
$scope.active = function (route) {
return $state.is(route);
};
$scope.$on("$stateChangeSuccess", function() {
$scope.tabs.forEach(function (tab) {
tab.active = $scope.active(tab.route);
});
});
});
ve index.html vücutta ui-görüntülemek devlet ile ilişkilendirilecek bir isim/rota
<body ng-app="Plunker">
<div ng-controller="tabsController">
<uib-tabset>
<uib-tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disable="tab.disabled">
<div ui-view="{{tab.route}}"></div>
</uib-tab>
</uib-tabset>
</div>
</body>
atamak yapılandırmak için bir açısal modül oluşturduk
Her sekmede, ilgili html dosya parçasından tab1.html, tab2.html veya tab1.html'den içerik bulunmalıdır. Ama işe yaramayacağım. Bu işi yapmak için herhangi bir yardım çok takdir edilecektir.
Bkz er rota, '' 'demenize gerek yok sadece sekmeleri css ve düzenli bağlantılar –
charlietfl
@charlietfl teşekkürler aklımda tutacağım. – Kickaha