mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Angular hacking
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
angular.module('ionic.ui', [])
|
angular.module('ionic.ui', ['ngTouch'])
|
||||||
|
|
||||||
.directive('content', function() {
|
.directive('content', function() {
|
||||||
return {
|
return {
|
||||||
@ -73,7 +73,7 @@ angular.module('ionic.ui', [])
|
|||||||
require: '^tabs',
|
require: '^tabs',
|
||||||
transclude: true,
|
transclude: true,
|
||||||
replace: true,
|
replace: true,
|
||||||
template: '<div class="tabs">' +
|
template: '<div class="tabs tabs-primary">' +
|
||||||
'<tab-item title="{{controller.title}}" icon="{{controller.icon}}" active="controller.isVisible" index="$index" ng-repeat="controller in controllers"></tab-item>' +
|
'<tab-item title="{{controller.title}}" icon="{{controller.icon}}" active="controller.isVisible" index="$index" ng-repeat="controller in controllers"></tab-item>' +
|
||||||
'</div>'
|
'</div>'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,19 +43,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<nav id="tab-bar" class="tabs tabs-success">
|
<nav id="tab-bar" class="tabs tabs-success">
|
||||||
<a class="tab-item" href="#">
|
|
||||||
<i class="icon-home"></i>
|
|
||||||
Friends
|
|
||||||
</a>
|
|
||||||
<a class="tab-item">
|
|
||||||
Enemies
|
|
||||||
</a>
|
|
||||||
<a class="tab-item">
|
|
||||||
Settings
|
|
||||||
</a>
|
|
||||||
<a class="tab-item">
|
|
||||||
More
|
|
||||||
</a>
|
|
||||||
</nav>
|
</nav>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|||||||
@ -23,16 +23,23 @@
|
|||||||
</header>
|
</header>
|
||||||
<content has-header="true" has-tabs="true">
|
<content has-header="true" has-tabs="true">
|
||||||
<h1>Home</h1>
|
<h1>Home</h1>
|
||||||
|
<ul class="list" ng-controller="HomeCtrl">
|
||||||
|
<a href="#" class="list-item" ng-repeat="item in items">
|
||||||
|
{{item.title}}
|
||||||
|
</a>
|
||||||
|
</ul>
|
||||||
</content>
|
</content>
|
||||||
</tab-controller>
|
</tab-controller>
|
||||||
|
|
||||||
<tab-controller title="About">
|
<tab-controller title="About">
|
||||||
<header class="bar bar-header bar-dark">
|
<header class="bar bar-header bar-success">
|
||||||
<h1 class="title">About</h1>
|
<h1 class="title">About</h1>
|
||||||
</header>
|
</header>
|
||||||
<content has-header="true" has-tabs="true">
|
<content has-header="true" has-tabs="true">
|
||||||
<h1>About Us</h1>
|
<h1>About Us</h1>
|
||||||
</content>
|
</content>
|
||||||
</tab-controller>
|
</tab-controller>
|
||||||
|
|
||||||
<tab-controller title="Settings">
|
<tab-controller title="Settings">
|
||||||
<header class="bar bar-header bar-dark">
|
<header class="bar bar-header bar-dark">
|
||||||
<h1 class="title">Settings</h1>
|
<h1 class="title">Settings</h1>
|
||||||
@ -46,7 +53,16 @@
|
|||||||
<script src="TabBarController.js"></script>
|
<script src="TabBarController.js"></script>
|
||||||
<script src="TabAngular.js"></script>
|
<script src="TabAngular.js"></script>
|
||||||
<script>
|
<script>
|
||||||
angular.module('tabsTest', ['ionic.ui']);
|
angular.module('tabsTest', ['ionic.ui'])
|
||||||
|
|
||||||
|
.controller('HomeCtrl', function($scope) {
|
||||||
|
$scope.items = [];
|
||||||
|
for(var i = 0; i < 100; i++) {
|
||||||
|
$scope.items.push({
|
||||||
|
title: 'Item ' + i
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user