Skip to content

Commit

Permalink
docs(): Add docs for ionicViewState, polish other docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Mar 11, 2014
1 parent dc22bd5 commit f9766fc
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 29 deletions.
3 changes: 3 additions & 0 deletions js/ext/angular/src/controller/ionicScrollController.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

angular.module('ionic.ui.scroll')

/**
* @private
*/
.controller('$ionicScroll', ['$scope', 'scrollViewOptions', '$timeout', '$ionicScrollDelegate', '$window', function($scope, scrollViewOptions, $timeout, $ionicScrollDelegate, $window) {

var self = this;
Expand Down
27 changes: 21 additions & 6 deletions js/ext/angular/src/directive/ionicContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ angular.module('ionic.ui.content', ['ionic.ui.service', 'ionic.ui.scroll'])
* Panel is a simple 100% width and height, fixed panel. It's meant for content to be
* added to it, or animated around.
*/
/**
* @ngdoc directive
* @name ionPane
* @module ionic
* @restrict E
*
* @description A simple container that fits content, with no side effects. Adds the 'pane' class to the element.
*/
.directive('ionPane', function() {
return {
restrict: 'E',
Expand All @@ -27,7 +35,7 @@ angular.module('ionic.ui.content', ['ionic.ui.service', 'ionic.ui.scroll'])
*
* While we recommend using the custom Scroll features in Ionic in most cases, sometimes (for performance reasons) only the browser's native overflow scrolling will suffice, and so we've made it easy to toggle between the Ionic scroll implementation and overflow scrolling.
*
* You can implement pull-to-refresh with the {@link ionic.directive:ionRefresher ionRefresher} directive, and infinite scrolling with the {@link ionic.directive:ionInfiniteScroll ionInfiniteScroll} directive.
* You can implement pull-to-refresh with the {@link ionic.directive:ionRefresher} directive, and infinite scrolling with the {@link ionic.directive:ionInfiniteScroll} directive.
*
* @restrict E
* @param {boolean=} scroll Whether to allow scrolling of content. Defaults to true.
Expand Down Expand Up @@ -190,15 +198,21 @@ function($parse, $timeout, $ionicScrollDelegate, $controller, $ionicBind) {
* @ngdoc directive
* @name ionInfiniteScroll
* @module ionic
* @parent ionContent, ionScroll
* @restrict E
*
* @description
* The ionInfiniteScroll directive, when placed inside of {@link ionic.directive:ionContent ionContent}, allows you to call a function whenever the user gets to the bottom of the page or near the bottom of the page.
* The ionInfiniteScroll directive, when placed inside of
* {@link ionic.directive:ionContent}, allows you to call a function whenever
* the user gets to the bottom of the page or near the bottom of the page.
*
* The expression you pass in for `on-infinite` is called when the user scrolls greater than `distance` away from the bottom of the content.
* The expression you pass in for `on-infinite` is called when the user scrolls
* greater than `distance` away from the bottom of the content.
*
* @param {expression} on-infinite What to call when the scroller reaches the bottom.
* @param {string=} distance The distance from the bottom that the scroll must reach to trigger the on-infinite expression. Default 1%.
* @param {expression} on-infinite What to call when the scroller reaches the
* bottom.
* @param {string=} distance The distance from the bottom that the scroll must
* reach to trigger the on-infinite expression. Default 1%.
*
* @usage
* ```html
Expand All @@ -221,7 +235,8 @@ function($parse, $timeout, $ionicScrollDelegate, $controller, $ionicBind) {
* }
* ```
*
* An easy to way to stop infinite scroll once there is no more data to load is to use angular's `ng-if` directive:
* An easy to way to stop infinite scroll once there is no more data to load
* is to use angular's `ng-if` directive:
*
* ```html
* <ion-infinite-scroll
Expand Down
4 changes: 2 additions & 2 deletions js/ext/angular/src/directive/ionicList.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ angular.module('ionic.ui.list', ['ngAnimate'])
* list item requires the item class. Ionic also comes with pre-built Angular
* directives to make it easier to create a complex list.
*
* Using the ionList and {@link ionic.directive:ionItem ionItem} directives
* Using the ionList and {@link ionic.directive:ionItem} directives
* make it easy to support various interaction modes such as swipe to edit,
* drag to reorder, and removing items.
*
* However, if you need just a simple list you won't be required to use the
* directives, but rather just use the classnames.
* This demo is a simple list without using the directives.
*
* See the {@link ionic.directive:ionItem ionItem documentation} for more information on list items.
* See the {@link ionic.directive:ionItem} documentation for more information on list items.
*
* @usage
* ```html
Expand Down
2 changes: 1 addition & 1 deletion js/ext/angular/src/directive/ionicNavAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ angular.module('ionic.ui.navAnimation', [])
* @parent ionNavView
*
* @description
* When used under an {@link ionic.directive:ionNavView ionNavView} and on an `<a>` element,
* When used under an {@link ionic.directive:ionNavView} and on an `<a>` element,
* allows you to set the animation all clicks on that link within the navView use.
*
* @usage
Expand Down
2 changes: 1 addition & 1 deletion js/ext/angular/src/directive/ionicRadio.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ angular.module('ionic.ui.radio', [])
$element.addClass('active');
}
});

ionic.on('tap', clickHandler, $element[0]);

$scope.$on('$destroy', function() {
Expand Down
17 changes: 16 additions & 1 deletion js/ext/angular/src/directive/ionicScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@

angular.module('ionic.ui.scroll', [])

/**
* @ngdoc directive
* @name ionScroll
* @module ionic
* @restrict E
*
* @description
* Creates a scrollable container for all content inside.
*
* @param {string=} direction Which way to scroll. 'x' or 'y'. Default 'y'.
* @param {boolean=} paging Whether to scroll with paging.
* @param {expression=} on-refresh Called on pull-to-refresh, triggered by an {@link ionic.directive:ionRefresher}.
* @param {expression=} on-scroll Called whenever the user scrolls.
* @param {boolean=} scrollbar-x Whether to show the horizontal scrollbar. Default false.
* @param {boolean=} scrollbar-x Whether to show the vertical scrollbar. Default true.
*/
.directive('ionScroll', ['$parse', '$timeout', '$controller', function($parse, $timeout, $controller) {
return {
restrict: 'E',
Expand All @@ -14,7 +30,6 @@ angular.module('ionic.ui.scroll', [])
paging: '@',
onRefresh: '&',
onScroll: '&',
refreshComplete: '=',
scroll: '@',
scrollbarX: '@',
scrollbarY: '@',
Expand Down
12 changes: 6 additions & 6 deletions js/ext/angular/src/directive/ionicSideMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
* ![Side Menu](http://ionicframework.com.s3.amazonaws.com/docs/controllers/sidemenu.gif)
*
* For more information on side menus, check out the documenation for
* {@link ionic.directive:ionSideMenuContent ionSideMenuContent} and
* {@link ionic.directive:ionSideMenu ionSideMenu}.
* {@link ionic.directive:ionSideMenuContent} and
* {@link ionic.directive:ionSideMenu}.
*
* @usage
* To use side menus, add an `<ion-side-menus>` parent element,
Expand Down Expand Up @@ -85,7 +85,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
* }
* ```
*
* @param {expression=} model The model to assign this side menu container's {@link ionic.controller:ionicSideMenus ionicSideMenus} controller to. By default, assigns to $scope.sideMenuController.
* @param {expression=} model The model to assign this side menu container's {@link ionic.controller:ionicSideMenus} controller to. By default, assigns to $scope.sideMenuController.
*
*/
.directive('ionSideMenus', function() {
Expand Down Expand Up @@ -120,7 +120,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
*
* @description
* A container for the main visible content, sibling to one or more
* {@link ionic.directive:ionSideMenu ionSideMenu} directives.
* {@link ionic.directive:ionSideMenu} directives.
*
* An attribute directive, recommended to be used as part of an `<ion-pane>` element.
*
Expand All @@ -131,7 +131,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
* </div>
* ```
* For a complete side menu example, see the
* {@link ionic.directive:ionSideMenus#usage ionSideMenus} documentation.
* {@link ionic.directive:ionSideMenus} documentation.
*
* @param {boolean=} drag-content Whether the content can be dragged.
*
Expand Down Expand Up @@ -256,7 +256,7 @@ angular.module('ionic.ui.sideMenu', ['ionic.service.gesture', 'ionic.service.vie
* </ion-side-menu>
* ```
* For a complete side menu example, see the
* {@link ionic.directive:ionSideMenus#usage ionSideMenus} documentation.
* {@link ionic.directive:ionSideMenus} documentation.
*
* @param {string} side Which side the side menu is currently on. Allowed values: 'left' or 'right'.
* @param {boolean=} is-enabled Whether this side menu is enabled.
Expand Down
2 changes: 1 addition & 1 deletion js/ext/angular/src/directive/ionicSlideBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ angular.module('ionic.ui.slideBox', [])
* </ion-slide-box>
* ```
*
* @param {expression=} model The model to assign this slide box container's {@link ionic.controller:ionicSlideBox ionicSlideBox} controller to. By default, assigns to $scope.slideBoxController.
* @param {expression=} model The model to assign this slide box container's {@link ionic.controller:ionicSlideBox} controller to. By default, assigns to $scope.slideBoxController.
* @param {boolean=} does-continue Whether the slide box should automatically slide.
* @param {number=} slide-interval How many milliseconds to wait to change slides (if does-continue is true). Defaults to 4000.
* @param {boolean=} show-pager Whether a pager should be shown for this slide box.
Expand Down
14 changes: 7 additions & 7 deletions js/ext/angular/src/directive/ionicTabBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
* @module ionic
*
* @description
* Controller for the {@link ionic.directive:ionTabs ionTabs} directive.
* Controller for the {@link ionic.directive:ionTabs} directive.
*/
.controller('ionicTabs', ['$scope', '$ionicViewService', '$element', function($scope, $ionicViewService, $element) {
var _selectedTab = null;
Expand Down Expand Up @@ -81,7 +81,7 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
* @param {boolean=} shouldChangeHistory Whether this selection should load this tab's view history
* (if it exists) and use it, or just loading the default page. Default false.
* Hint: you probably want this to be true if you have an
* {@link ionic.directive:ionNavView ionNavView} inside your tab.
* {@link ionic.directive:ionNavView} inside your tab.
*/
self.select = function(tab, shouldEmitEvent) {
var tabIndex;
Expand Down Expand Up @@ -138,7 +138,7 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
* @description
* Powers a multi-tabbed interface with a Tab Bar and a set of "pages" that can be tabbed through.
*
* See the {@link ionic.directive:ionTab ionTab} directive's documentation for more details.
* See the {@link ionic.directive:ionTab} directive's documentation for more details.
*
* @usage
* ```html
Expand All @@ -158,7 +158,7 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
* </ion-tabs>
* ```
*
* @param {expression=} model The model to assign this tabbar's {@link ionic.controller:ionicTabs ionicTabs} controller to. By default, assigns to $scope.tabsController.
* @param {expression=} model The model to assign this tabbar's {@link ionic.controller:ionicTabs} controller to. By default, assigns to $scope.tabsController.
* @param {string=} animation The animation to use when changing between tab pages.
* @param {string=} tabs-style The class to apply to the tabs. Defaults to 'tabs-positive'.
* @param {string=} tabs-type Whether to put the tabs on the top or bottom. Defaults to 'tabs-bottom'.
Expand Down Expand Up @@ -230,7 +230,7 @@ function($scope, $ionicViewService, $rootScope, $element) {
* on-deselect="onTabDeselected()">
* </ion-tab>
* ```
* For a complete, working tab bar example, see the {@link ionic.directive:ionTabs ionTabs} documentation.
* For a complete, working tab bar example, see the {@link ionic.directive:ionTabs} documentation.
*
* @param {string} title The title of the tab.
* @param {string=} href The link that this tab will navigate to when tapped.
Expand All @@ -239,8 +239,8 @@ function($scope, $ionicViewService, $rootScope, $element) {
* @param {string=} icon-off The icon of the tab while it is not selected.
* @param {expression=} badge The badge to put on this tab (usually a number).
* @param {expression=} badge-style The style of badge to put on this tab (eg tabs-positive).
* @param {expression=} left-buttons The left buttons to use on a parent {@link ionic.directive:ionNavBar ionNavBar} while this tab is selected.
* @param {expression=} right-buttons The right buttons to use on a parent {@link ionic.directive:ionNavBar ionNavBar} while this tab is selected.
* @param {expression=} left-buttons The left buttons to use on a parent {@link ionic.directive:ionNavBar} while this tab is selected.
* @param {expression=} right-buttons The right buttons to use on a parent {@link ionic.directive:ionNavBar} while this tab is selected.
* @param {expression=} on-select Called when this tab is selected.
* @param {expression=} on-deselect Called when this tab is deselected.
*/
Expand Down
16 changes: 14 additions & 2 deletions js/ext/angular/src/directive/ionicToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@

angular.module('ionic.ui.toggle', [])

// The Toggle directive is a toggle switch that can be tapped to change
// its value
/**
* @ngdoc directive
* @name ionToggle
* @module ionic
* @restrict E
*
* @description
* An animated switch which binds a given model to a boolean.
*
* Allows dragging of the switch's nub.
*
* Behaves like any [AngularJS checkbox](http://docs.angularjs.org/api/ng/input/input[checkbox]) otherwise.
*
*/
.directive('ionToggle', ['$ionicGesture', '$timeout', function($ionicGesture, $timeout) {

return {
Expand Down
Loading

0 comments on commit f9766fc

Please sign in to comment.