我正在使用基础Ionic2 Blank应用程序。当我在home.ts中使用以下行实例化Azure时
import azureMobileClient from 'azure-mobile-apps-client';
,它没有错误地部署。故障只是纹波上的空白屏幕或设备上的空白屏幕。我没有看到构建中的任何错误。
当前设置: Win10 x64 Visual Studio 2015社区 Cordova CLI:6.3.1 Ionic Framework版本:2.0.0-rc.1 Ionic CLI版本:2.1.1 Ionic App Lib版本:2.1.1 节点版本:v4.6.0
以下是我采取的步骤
的package.json
{
"name": "io.cordova.myapp3e6a78",
"private": true,
"version": "0.0.1",
"description": "ionic2-ts-blank: An Ionic project",
"dependencies": {
"@angular/common": "2.0.0-rc.3",
"@angular/compiler": "2.0.0-rc.3",
"@angular/core": "2.0.0-rc.3",
"@angular/platform-browser": "2.0.0-rc.3",
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
"@angular/http": "2.0.0-rc.3",
"es6-shim": "^0.35.0",
"ionic-angular": "2.0.0-beta.10",
"ionic-native": "1.2.4",
"ionicons": "3.0.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"azure-mobile-apps-client": "^2.0.0-rc1"
},
"devDependencies": {
"del": "2.2.0",
"gulp": "3.9.1",
"gulp-watch": "4.3.5",
"ionic-gulp-browserify-typescript": "2.0.0",
"ionic-gulp-fonts-copy": "^1.0.0",
"ionic-gulp-html-copy": "^1.0.0",
"ionic-gulp-sass-build": "^1.0.0",
"ionic-gulp-scripts-copy": "^2.0.0",
"run-sequence": "1.1.5",
"typings": "^1.3.1"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [ ],
"scripts": {
"build": "node_modules/.bin/gulp build",
"typings": "node_modules/.bin/typings install",
"postinstall": "npm run typings && npm run build"
}
}
declarations.d.ts
declare module 'azure-mobile-apps-client';
home.ts
import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
import azureMobileClient from 'azure-mobile-apps-client';
@Component({
templateUrl: 'build/pages/home/home.html'
})
export class HomePage {
constructor(private navController: NavController) {
}
onLink(url: string) {
window.open(url);
}
}
答案 0 :(得分:0)
您实际上并没有在代码中使用azureMobileClient,除了引入它之外.ENOENT意味着它没有被下载。您需要成功安装npm才能使用它。然后你实际上需要使用它。