小编kat*_*n A的帖子

“ npx cap add ios”失败,并显示错误“使用 pod install 更新 iOS 本机依赖项 - 失败!”

我刚刚创建了一个全新的 Ionic 应用程序,使用命令“ionic start myApp Blank”

\n

我添加了必要的角度依赖性以使“离子服务”正常工作。

\n

我已经使用以下命令安装了电容器

\n
npm install @capacitor/cli @capacitor/core\nnpx cap init\n\nnpm install @capacitor/ios @capacitor/android\n
Run Code Online (Sandbox Code Playgroud)\n

我的 Package.json 如下所示,

\n
{\n  "name": "myApp",\n  "version": "0.0.1",\n  "author": "Ionic Framework",\n  "homepage": "https://ionicframework.com/",\n  "scripts": {\n    "ng": "ng",\n    "start": "ng serve",\n    "build": "ng build",\n    "test": "ng test",\n    "lint": "ng lint",\n    "e2e": "ng e2e"\n  },\n  "private": true,\n  "dependencies": {\n    "@angular/common": "~12.1.1",\n    "@angular/core": "~12.1.1",\n    "@angular/forms": "~12.1.1",\n    "@angular/platform-browser": "~12.1.1",\n    "@angular/platform-browser-dynamic": "~12.1.1",\n    "@angular/router": "~12.1.1",\n    "@capacitor/android": "^3.2.4",\n    "@capacitor/app": "1.0.3",\n    "@capacitor/core": "^3.2.4",\n    "@capacitor/haptics": "1.1.0",\n    "@capacitor/ios": …
Run Code Online (Sandbox Code Playgroud)

xcode ios ionic-framework angular capacitor

20
推荐指数
3
解决办法
3万
查看次数

Angular 7:文件更改后,“ ng serve --aot”失败

第一次成功的“ ng serve --aot”,每次更改文件后都会失败,并显示以下错误

调试失败中的错误。错误表达:主机不应从`getSourceFile`返回重定向源文件
我?wdm ?:编译失败。

重新运行该命令将再次起作用。

关于发布在“ https://github.com/angular/angular-cli/issues/11835 ”中的内容,我尝试将“ @ angular / compiler-cli”的等级降级为“ 6.1.1”。它没有帮助。

我的package.json的内容如下,

ERROR in Debug Failure. False expression: Host should not return a redirect source file from `getSourceFile`
i ?wdm?: Failed to compile.

感谢所有帮助,以帮助我找到一种方法,使“ ng serve --aot”在每次文件更改时都能正确地编译代码。谢谢

angular

9
推荐指数
1
解决办法
1720
查看次数

".../node_modules/rxjs/Rx"没有导出成员'throwError'

Angular文档讲述了一个" throwError "类,其import语句如下所示

import { Observable, throwError } from 'rxjs';
Run Code Online (Sandbox Code Playgroud)

但我的编译器无法找到该类,并抱怨以下错误消息

错误在src/app/shared/services/myservice.service.ts(3,10)中:错误TS2305:模块'"D:/ workspace/dev/MyProject/node_modules/rxjs/Rx"'没有导出成员'throwError' .

以下是我的环境细节

Angular CLI: 1.6.8
Node: 8.11.1
OS: win32 x64
Angular: 5.2.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

@angular/cdk: 5.2.4
@angular/cli: 1.6.8
@angular/material: 5.2.4
@angular/service-worker: 1.0.0-beta.16
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.4.5
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.4.2
webpack: 3.10.0
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

rxjs typescript angular

8
推荐指数
2
解决办法
7483
查看次数

Angular 6 - TypeError:this.driver.matchesElement不是TransitionAnimationEngine.processLeaveNode(browser.js:2985)中的函数

注意:这不是此错误.已尝试过该错误中提到的解决步骤.

我在Angular 6应用程序中收到以下错误

ERROR TypeError: this.driver.matchesElement is not a function
at TransitionAnimationEngine.processLeaveNode (browser.js:2985)
at TransitionAnimationEngine.flush (browser.js:3021)
at InjectableAnimationEngine.AnimationEngine.flush (browser.js:3858)
at eval (animations.js:365)
at ZoneDelegate.invoke (zone.js:388)
at Zone.run (zone.js:138)
at NgZone.runOutsideAngular (core.js:4708)
at AnimationRendererFactory.end (animations.js:363)
at DebugRendererFactory2.end (core.js:15153)
at ViewRef_.detectChanges (core.js:11623)
Run Code Online (Sandbox Code Playgroud)

angular6

4
推荐指数
1
解决办法
3609
查看次数

javascript if(-1){... statement ...}的计算结果为true

我有一个条件,其中0或更多是有效的,负面是无效的.当我在JavaScript/TypeScript中相应地编写代码时,令我惊讶的是它没有像我预期的那样工作.

代码如下.

if (-1) {
  console.log("truthy")
} else {
  console.log("falsy")
}
Run Code Online (Sandbox Code Playgroud)

这将在控制台中打印以下内容.

truthy

它应该是falsy,对吧?

任何帮助,帮助我理解这种行为.我错过了什么?

谢谢

javascript typescript

-5
推荐指数
1
解决办法
55
查看次数