安装Native Store成功后,使用本地插件ionic 3出现问题,但是当我尝试添加应用模块时,文本编辑器显示红线,而当我尝试运行时,发现了如下错误。我在这里安装本机商店(https://ionicframework.com/docs/v3/native/native-storage/)
文本编辑器中的红线,安装成功,但是在应用模块中添加时显示红线。

当运行“ ionic cordova run android”时,这是控制台中的错误。
[14:40:05] ionic-app-scripts 3.1.8
[14:40:05] build dev started ...
[14:40:05] clean started ...
[14:40:05] clean finished in 71 ms
[14:40:05] copy started ...
[14:40:07] deeplinks started ...
[14:40:08] deeplinks finished in 1.04 s
[14:40:08] transpile started ...
[14:40:27] typescript: D:/myProject/ionic/myApp/src/app/app.module.ts, line: 57
Argument of type '{ declarations: (typeof VerificationPage | typeof LoginPage | typeof PrivacyRegisterPage |
typeof...' is not assignable to parameter of type 'NgModule'. Types of property 'providers' are …Run Code Online (Sandbox Code Playgroud) 我很茫然。我可以使水平滚动仅与html和css一起正常工作,但是当我介绍ngFor时,它拒绝产生相同的效果。是否有人对此有经验,或者知道如何解决此问题?
这是我不起作用的简单代码:
这个例子产生一个垂直列表:
<div class="container" *ngFor="let item of items | async">
<div class="scroll" scrollX="true">
<span>{{item.ProjectEvent}}</span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这产生了一个可以水平滚动的宽容器
<div class="container" >
<div class="scroll" scrollX="true">
<span>item1</span>
<span>item2</span>
<span>item3</span>
<span>item4</span>
<span>item5</span>
<span>item6</span>
<span>item7</span>
<span>item8</span>
<span>item9</span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
两者的CSS相同:
.container {
width: 100px;
background-color: green;
overflow: hidden;
white-space: nowrap;
::-webkit-scrollbar {
display: none;
}
.scroll {
overflow: auto;
}
}
Run Code Online (Sandbox Code Playgroud)
向我解释一下史波克先生!
我在这里先向您的帮助表示感谢!
良好措施的依赖性:
"dependencies": {
"@angular/common": "^7.1.4",
"@angular/core": "^7.1.4",
"@angular/fire": "^5.1.1",
"@angular/forms": "^7.1.4",
"@angular/http": "^7.1.4",
"@angular/platform-browser": "^7.1.4",
"@angular/platform-browser-dynamic": "^7.1.4",
"@angular/router": "^7.1.4",
"@ionic-native/core": "5.0.0-beta.21", …Run Code Online (Sandbox Code Playgroud) 我使用下面的最新版本的Ionic CLI v4.9.0创建了新的Ionic 3应用程序
$ ionic start Ionic3Project blank --type ionic-angular
Run Code Online (Sandbox Code Playgroud)
默认情况下会创建V4 Ionic项目。
然后我在这里按照步骤进行本机应用程序版本插件
导入app.module.ts文件时遇到以下控制台错误
Uncaught Error: Invalid provider for the NgModule 'AppModule' - only instances of Provider and Type are allowed, got: [StatusBar, ?[object Object]?, ...]
at syntaxError (compiler.js:486)
at compiler.js:15784
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (compiler.js:15752)
at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15320)
at JitCompiler._loadModules (compiler.js:34413)
at JitCompiler._compileModuleAndComponents (compiler.js:34374)
at JitCompiler.compileModuleAsync (compiler.js:34268)
at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:239)
at PlatformRef.bootstrapModule (core.js:5578)
Run Code Online (Sandbox Code Playgroud)
app.module.ts文件
import { BrowserModule } from '@angular/platform-browser';
import { …Run Code Online (Sandbox Code Playgroud) 我已经安装了文件传输插件,因为它在这里提到
这是app.module.ts中的代码:
import { FileTransfer } from '@ionic-native/file-transfer';
providers: [
...
FileTransfer,
...
]
Run Code Online (Sandbox Code Playgroud)
这是错误
类型“ FileTransferOriginal”不可分配给“提供者”类型。类型'FileTransferOriginal'缺少类型'FactoryProvider'的以下属性:提供,useFactoryts(2322)(别名)const FileTransfer:FileTransferOriginal导入FileTransfer
我正在尝试使用以下方式将图像上传到服务器
"cordova-plugin-file-transfer": "^1.7.1",
"@ionic-native/file-transfer": "^5.0.0",
Run Code Online (Sandbox Code Playgroud)
component.ts
takePicture() {
const options: CameraOptions = {
quality: 50,
destinationType: this.camera.DestinationType.FILE_URI,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY,
targetWidth: 500,
targetHeight: 500,
saveToPhotoAlbum: false
};
this.camera.getPicture(options)
.then((imageData) => this._img.uploadImage(imageData))
.catch(err => console.log(err));
}
Run Code Online (Sandbox Code Playgroud)
imageProvider.ts
import { FileTransfer, FileUploadOptions, FileTransferObject } from "@ionic-native/file-transfer/ngx";
...
uploadImage(img) {
const url = `${this.apiURL}/images/upload`;
// File for Upload
var targetPath = img;
var options: FileUploadOptions = {
fileKey: 'image',
chunkedMode: false,
mimeType: 'multipart/form-data'
};
const fileTransfer: FileTransferObject = this.transfer.create();
fileTransfer.upload(targetPath, …Run Code Online (Sandbox Code Playgroud) 无论我如何尝试,都无法从ionic / cordova项目访问Xcode模拟器。Xcode命令行工具已安装。
cordova run ios --list
Run Code Online (Sandbox Code Playgroud)
退货
可用的ios设备:
可用的ios虚拟设备:
ionic cordova emulate ios --list
Run Code Online (Sandbox Code Playgroud)
退货
可用的ios虚拟设备:
我在Xcode中拥有所有模拟器,当我在Xcode中打开项目并手动运行模拟器时,它运行良好。
这样的后果是我无法通过终端的livereload运行我的应用程序:
ionic cordova emulate --livereload ios -- --buildFlag="-UseModernBuildSystem=0" --target="iPhone-X, 12.1"
Run Code Online (Sandbox Code Playgroud)
退货
找不到设备名称“ iPhone X”和运行时“ iOS 12.1”的设备ID,或者该设备ID不可用。
我的离子项目中有一个微调器。我想将微调器放在屏幕的中央位置。但它始终显示在左上角,如下所示:
HTML文件是:
<div *ngIf="spinner == 'true'">
<ion-spinner name="bubbles"></ion-spinner>
</div>
Run Code Online (Sandbox Code Playgroud)
我的scss文件是:
page-login {
ion-spinner {
width: 28px;
height: 28px;
stroke: #444;
fill: #222;
}
}
Run Code Online (Sandbox Code Playgroud)
你能帮我吗?
我是Angular的新手,正面临这个问题。
我想检查变量的值elementRef是否在显示数据之前为空,因为我想显示图表。这是我的代码:
component.ts
@ViewChild('normalDeviasiDaily', {read: ElementRef}) normalDeviasiDaily: ElementRef;
Run Code Online (Sandbox Code Playgroud)
component.html
<div *ngIf="normalDeviasiDaily">
<div #normalDeviasiDaily id="normalDeviasiDaily">
<canvas style="width:100%; height:400px;"></canvas>
</div>
</div>
<div *ngIf="!normalDeviasiDaily">
<skeleton-item height="400px"></skeleton-item>
</div>
Run Code Online (Sandbox Code Playgroud)
我的问题是cannot read property nativeElement of undefined,有没有其他人遇到过,请帮助我。
谢谢。
I am working in my Ionic 4 project and I have added the ion-avatar but it is not coming in the center of the
This is my editprofile.page.html:
<ion-item class="newitem2">
<ion-avatar>
<img name="profile_pic" [src]="this.userdetailsedit.value.profile_pic"/>
</ion-avatar>
</ion-item>
Run Code Online (Sandbox Code Playgroud)
Any help is much appreciated.
我已经ionic安装了系统。当我运行时,ionic run app tabs它会安装所有npm软件包,但提示落到
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-72_binding.node":
HTTP error 404 Not Found
Run Code Online (Sandbox Code Playgroud)
然后失败,并显示提示
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/velansalis/code/greenlink/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/home/velansalis/.nvm/versions/node/v12.0.0/bin/node" "/home/velansalis/code/greenlink/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/velansalis/code/greenlink/node_modules/node-sass
gyp ERR! node -v v12.0.0 …Run Code Online (Sandbox Code Playgroud) ionic-framework ×10
ionic3 ×3
ionic4 ×3
angular ×2
angular5 ×1
build ×1
cordova ×1
css ×1
installation ×1
ionic-native ×1
ios ×1
ngfor ×1
node.js ×1
npm ×1
xcode ×1