【发布时间】:2018-07-07 18:19:16
【问题描述】:
我是一个离子新手,我似乎无法弄清楚这一点。我在 Ionic Creator 中创建了一个项目,然后导出了 Zip。现在我有了controller.js、services.js 文件等,但它们看起来不像文档中的示例源:https://ionicframework.com/docs/components/#action-sheets
当我尝试查找示例时,我看到类似 https://github.com/ionic-team/ionic-preview-app/tree/master/src/pages/action-sheets/basic 的内容,但代码符合文档中的内容。
例如,从controllers.js 导出的内容如下:
angular.module('app.controllers', [])
.controller('page1Ctrl', ['$scope', '$stateParams', // The following is the constructor function for this page's controller. See https://docs.angularjs.org/guide/controller
// You can include any angular dependencies as parameters for this function
// TIP: Access Route Parameters for your page via $stateParams.parameterName
function ($scope, $stateParams) {
}])
虽然示例代码像类一样构建:
import { ActionSheetController } from 'ionic-angular';
export class MyPage {
constructor(public actionSheetCtrl: ActionSheetController) { }
那么问题来了:
我将如何在 Ionic Creator 导出的结构中使用 ionViewDidEnter?
【问题讨论】:
标签: ionic-framework