mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
docs(documentation): cosmetically improve the documentation
This commit is contained in:
@ -39,10 +39,10 @@ import { Config } from '../../config/config';
|
|||||||
*
|
*
|
||||||
* export class MyClass{
|
* export class MyClass{
|
||||||
*
|
*
|
||||||
* constructor(public actionSheetCtrl: ActionSheetController) {}
|
* constructor(public actionSheetCtrl: ActionSheetController) { }
|
||||||
*
|
*
|
||||||
* presentActionSheet() {
|
* presentActionSheet() {
|
||||||
* let actionSheet = this.actionSheetCtrl.create({
|
* const actionSheet = this.actionSheetCtrl.create({
|
||||||
* title: 'Modify your album',
|
* title: 'Modify your album',
|
||||||
* buttons: [
|
* buttons: [
|
||||||
* {
|
* {
|
||||||
@ -115,14 +115,14 @@ import { Config } from '../../config/config';
|
|||||||
* out first, *then* start the next transition.
|
* out first, *then* start the next transition.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* let actionSheet = this.actionSheetCtrl.create({
|
* const actionSheet = this.actionSheetCtrl.create({
|
||||||
* title: 'Hello',
|
* title: 'Hello',
|
||||||
* buttons: [{
|
* buttons: [{
|
||||||
* text: 'Ok',
|
* text: 'Ok',
|
||||||
* handler: () => {
|
* handler: () => {
|
||||||
* // user has clicked the action sheet button
|
* // user has clicked the action sheet button
|
||||||
* // begin the action sheet's dimiss transition
|
* // begin the action sheet's dimiss transition
|
||||||
* let navTransition = actionSheet.dismiss();
|
* const navTransition = actionSheet.dismiss();
|
||||||
*
|
*
|
||||||
* // start some async method
|
* // start some async method
|
||||||
* someAsyncOperation().then(() => {
|
* someAsyncOperation().then(() => {
|
||||||
|
@ -51,12 +51,10 @@ import { Config } from '../../config/config';
|
|||||||
* ```ts
|
* ```ts
|
||||||
* import { AlertController } from 'ionic-angular';
|
* import { AlertController } from 'ionic-angular';
|
||||||
*
|
*
|
||||||
* constructor(private alertCtrl: AlertController) {
|
* constructor(private alertCtrl: AlertController) { }
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
*
|
||||||
* presentAlert() {
|
* presentAlert() {
|
||||||
* let alert = this.alertCtrl.create({
|
* const alert = this.alertCtrl.create({
|
||||||
* title: 'Low battery',
|
* title: 'Low battery',
|
||||||
* subTitle: '10% of battery remaining',
|
* subTitle: '10% of battery remaining',
|
||||||
* buttons: ['Dismiss']
|
* buttons: ['Dismiss']
|
||||||
@ -65,7 +63,7 @@ import { Config } from '../../config/config';
|
|||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* presentConfirm() {
|
* presentConfirm() {
|
||||||
* let alert = this.alertCtrl.create({
|
* const alert = this.alertCtrl.create({
|
||||||
* title: 'Confirm purchase',
|
* title: 'Confirm purchase',
|
||||||
* message: 'Do you want to buy this book?',
|
* message: 'Do you want to buy this book?',
|
||||||
* buttons: [
|
* buttons: [
|
||||||
@ -88,7 +86,7 @@ import { Config } from '../../config/config';
|
|||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* presentPrompt() {
|
* presentPrompt() {
|
||||||
* let alert = this.alertCtrl.create({
|
* const alert = this.alertCtrl.create({
|
||||||
* title: 'Login',
|
* title: 'Login',
|
||||||
* inputs: [
|
* inputs: [
|
||||||
* {
|
* {
|
||||||
@ -181,14 +179,14 @@ import { Config } from '../../config/config';
|
|||||||
* out first, *then* start the next transition.
|
* out first, *then* start the next transition.
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* let alert = this.alertCtrl.create({
|
* const alert = this.alertCtrl.create({
|
||||||
* title: 'Hello',
|
* title: 'Hello',
|
||||||
* buttons: [{
|
* buttons: [{
|
||||||
* text: 'Ok',
|
* text: 'Ok',
|
||||||
* handler: () => {
|
* handler: () => {
|
||||||
* // user has clicked the alert button
|
* // user has clicked the alert button
|
||||||
* // begin the alert's dismiss transition
|
* // begin the alert's dismiss transition
|
||||||
* let navTransition = alert.dismiss();
|
* const navTransition = alert.dismiss();
|
||||||
*
|
*
|
||||||
* // start some async method
|
* // start some async method
|
||||||
* someAsyncOperation().then(() => {
|
* someAsyncOperation().then(() => {
|
||||||
|
@ -49,12 +49,10 @@ import { LoadingOptions } from './loading-options';
|
|||||||
* ```ts
|
* ```ts
|
||||||
* import { LoadingController } from 'ionic-angular';
|
* import { LoadingController } from 'ionic-angular';
|
||||||
*
|
*
|
||||||
* constructor(public loadingCtrl: LoadingController) {
|
* constructor(public loadingCtrl: LoadingController) { }
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
*
|
||||||
* presentLoadingDefault() {
|
* presentLoadingDefault() {
|
||||||
* let loading = this.loadingCtrl.create({
|
* const loading = this.loadingCtrl.create({
|
||||||
* content: 'Please wait...'
|
* content: 'Please wait...'
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
@ -66,7 +64,7 @@ import { LoadingOptions } from './loading-options';
|
|||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* presentLoadingCustom() {
|
* presentLoadingCustom() {
|
||||||
* let loading = this.loadingCtrl.create({
|
* const loading = this.loadingCtrl.create({
|
||||||
* spinner: 'hide',
|
* spinner: 'hide',
|
||||||
* content: `
|
* content: `
|
||||||
* <div class="custom-spinner-container">
|
* <div class="custom-spinner-container">
|
||||||
@ -83,7 +81,7 @@ import { LoadingOptions } from './loading-options';
|
|||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* presentLoadingText() {
|
* presentLoadingText() {
|
||||||
* let loading = this.loadingCtrl.create({
|
* const loading = this.loadingCtrl.create({
|
||||||
* spinner: 'hide',
|
* spinner: 'hide',
|
||||||
* content: 'Loading Please Wait...'
|
* content: 'Loading Please Wait...'
|
||||||
* });
|
* });
|
||||||
|
@ -38,12 +38,10 @@ import { DeepLinker } from '../../navigation/deep-linker';
|
|||||||
* @Component(...)
|
* @Component(...)
|
||||||
* class HomePage {
|
* class HomePage {
|
||||||
*
|
*
|
||||||
* constructor(public modalCtrl: ModalController) {
|
* constructor(public modalCtrl: ModalController) { }
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
*
|
||||||
* presentProfileModal() {
|
* presentProfileModal() {
|
||||||
* let profileModal = this.modalCtrl.create(Profile, { userId: 8675309 });
|
* const profileModal = this.modalCtrl.create(Profile, { userId: 8675309 });
|
||||||
* profileModal.present();
|
* profileModal.present();
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
@ -37,12 +37,10 @@ import { ToastOptions } from './toast-options';
|
|||||||
*
|
*
|
||||||
* @usage
|
* @usage
|
||||||
* ```ts
|
* ```ts
|
||||||
* constructor(private toastCtrl: ToastController) {
|
* constructor(private toastCtrl: ToastController) { }
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
*
|
||||||
* presentToast() {
|
* presentToast() {
|
||||||
* let toast = this.toastCtrl.create({
|
* const toast = this.toastCtrl.create({
|
||||||
* message: 'User was added successfully',
|
* message: 'User was added successfully',
|
||||||
* duration: 3000,
|
* duration: 3000,
|
||||||
* position: 'top'
|
* position: 'top'
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
* import { NavParams } from 'ionic-angular';
|
* import { NavParams } from 'ionic-angular';
|
||||||
*
|
*
|
||||||
* export class MyClass {
|
* export class MyClass {
|
||||||
* constructor(public navParams: NavParams) {
|
* constructor(navParams: NavParams) {
|
||||||
* // userParams is an object we have in our nav-parameters
|
* // userParams is an object we have in our nav-parameters
|
||||||
* this.navParams.get('userParams');
|
* const params = navParams.get('userParams');
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
@ -16,9 +16,7 @@ import { Platform } from './platform';
|
|||||||
* @usage
|
* @usage
|
||||||
* ```ts
|
* ```ts
|
||||||
* export class MyClass {
|
* export class MyClass {
|
||||||
* constructor(public keyboard: Keyboard) {
|
* constructor(public keyboard: Keyboard) { }
|
||||||
*
|
|
||||||
* }
|
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
|
@ -13,7 +13,8 @@ import { ScrollView } from './scroll-view';
|
|||||||
* import { Events } from 'ionic-angular';
|
* import { Events } from 'ionic-angular';
|
||||||
*
|
*
|
||||||
* // first page (publish an event when a user is created)
|
* // first page (publish an event when a user is created)
|
||||||
* constructor(public events: Events) {}
|
* constructor(public events: Events) { }
|
||||||
|
*
|
||||||
* createUser(user) {
|
* createUser(user) {
|
||||||
* console.log('User created!')
|
* console.log('User created!')
|
||||||
* events.publish('user:created', user, Date.now());
|
* events.publish('user:created', user, Date.now());
|
||||||
|
@ -10,13 +10,13 @@ import { ErrorHandler } from '@angular/core';
|
|||||||
* ### IonicErrorHandler Example
|
* ### IonicErrorHandler Example
|
||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import { NgModule, ErrorHandler } from '@angular/core';
|
* import { ErrorHandler, NgModule } from '@angular/core';
|
||||||
* import { IonicErrorHandler } from 'ionic-angular';
|
* import { IonicErrorHandler } from 'ionic-angular';
|
||||||
*
|
*
|
||||||
* @NgModule({
|
* @NgModule({
|
||||||
* providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
|
* providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler }]
|
||||||
* })
|
* })
|
||||||
* class AppModule {}
|
* class AppModule { }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -35,7 +35,7 @@ import { ErrorHandler } from '@angular/core';
|
|||||||
* @NgModule({
|
* @NgModule({
|
||||||
* providers: [{ provide: ErrorHandler, useClass: MyErrorHandler }]
|
* providers: [{ provide: ErrorHandler, useClass: MyErrorHandler }]
|
||||||
* })
|
* })
|
||||||
* class AppModule {}
|
* class AppModule { }
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* More information about Angular's [`ErrorHandler`](https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html).
|
* More information about Angular's [`ErrorHandler`](https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html).
|
||||||
|
Reference in New Issue
Block a user