我正在使用Ionic3:
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Xcode 8.3.1 Build version 8E1000a
Run Code Online (Sandbox Code Playgroud)
我有以下字体: Ormont_Light.ttf
如您所见,我尝试在app.scss文件中应用此新字体.但是,我似乎无法让它生效.
如您所见,它仍然使用Ionic默认值:
font-family: "Roboto", "Helvetica Neue", sans-serif;
Run Code Online (Sandbox Code Playgroud)
题
请问任何人都可以建议如何使用ttfIonic 3中的文件实现新字体?
UPDATE
我添加以下内容:
@font-face {
font-family: Ormont_Light;
src: url(../assets/fonts/Ormont_Light.ttf) format("ttf");
font-weight: normal;
font-style: normal;
}
body { …Run Code Online (Sandbox Code Playgroud) 安装后我仍然没有看到3.0.1
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: macOS Sierra
Node Version: v6.10.1
Xcode version: Xcode 8.2.1 Build version 8C1002
Run Code Online (Sandbox Code Playgroud) 我不确定我是否遗漏了某些东西,但是当我尝试将一个跨度添加到Ion Item时,不会渲染范围,也不会显示div.
<ion-card>
<ion-card-title>
</ion-card-title>
<div>
<button ion-button (click)="toggleEdit()">Edit</button>
</div>
<ion-list>
<ion-card-content>
<ion-item [hidden]="editOptions.!isEditing">
<span class="inline-edit">Text</span>
<ion-label color="primary">{{label}}</ion-label>
<ion-input></ion-input>
<span class="inline-edit">{{value}} </span>
</ion-item>
<ion-item [hidden]="!editOptions.isEditing">
<ion-label color="primary">{{label}}</ion-label>
<ion-input [(ngModel)]="value" [required]="required" [type]="type" [name]="value"></ion-input>
</ion-item>
</ion-card-content>
</ion-list>
</ion-card>
Run Code Online (Sandbox Code Playgroud)
离子标签和输入显示和工作正常,但当我尝试在他们不渲染的项目中使用跨度或div时.即使我用铬检查它们.
如何呈现简单文本,我不允许在组件中使用HTML?什么是Ionic 2等效地渲染少量文本,看起来标签必须始终在输入上,所以我应该使用什么组件?
我正在尝试在桌面上首次安装ionic 3和cordova。我正在使用Windows 7。
npm install -g ionic cordova
Run Code Online (Sandbox Code Playgroud)
告诉我这个错误:
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
C:\Users\amir\AppData\Roaming\npm\cordova -> C:\Users\amir\AppData\Ro
C:\Users\amir\AppData\Roaming\npm\ionic -> C:\Users\amir\AppData\Roam
npm ERR! path C:\Users\amir\AppData\Roaming\npm\node_modules\ionic\no
.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\amir
s\fsevents\node_modules\ansi-regex\package.json'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\a
ules\fsevents\node_modules\ansi-regex\package.json'
npm ERR! at Error (native)
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink …Run Code Online (Sandbox Code Playgroud) 这个问题与使用深度链接和延迟加载Ionic 3时如何在管道文件中使用提供程序非常相似?但在这个问题上,我们不使用提供者。
我有2个延迟加载页面Page1和Page2,以及HomePage作为根页面。另外,MyPipe文件是管道文件。如下所示。我想在懒惰中使用此管道文件加载文件Page1,Page2和HomePage
情况1:如果我Pipe仅在app.module
然后发生以下错误
运行时错误,未捕获(承诺):错误:模板解析错误:找不到管道'myPipe'(“ {{[ERROR->]'test1'| myPipe}}”):ng:/// Page1PageModule / Page1Page .html @ 16:2错误:模板解析错误:找不到管道'myPipe'(“ {{[ERROR->]'test1'| myPipe}}”):
Case 2:如果我将Pipe文件导入到Page1Module和Page2Module
然后发生以下错误
运行时错误未捕获(承诺):错误:类型MyPipe是2个模块的声明的一部分:Page1PageModule和Page2PageModule!请考虑将MyPipe移至导入Page1PageModule和Page2PageModule的更高模块。您还可以创建一个新的NgModule,该导出并包含MyPipe,然后在Page1PageModule和Page2PageModule中导入该NgModule。错误:类型MyPipe是2个模块的声明的一部分:Page1PageModule和Page2PageModule!请考虑将MyPipe移至导入Page1PageModule和Page2PageModule的更高模块。您还可以创建一个新的NgModule,该导出并包含MyPipe,然后在Page1PageModule和Page2PageModule中导入该NgModule。
感谢您的建议。
我试图创建一个离子应用程序,当我在离子创建器中将页面链接在一起时,.ts文件出现错误,如下所示:
typescript: src/pages/home/home.ts, line: 4
Individual declarations in merged declaration 'HomePage' must be all exported or all local.
L3: import { NotificationsPage } from '../notifications/notifications';
L4: import { HomePage } from '../home/home';
L5: import { MyPatientsPage } from '../my-patients/my-patients';
Run Code Online (Sandbox Code Playgroud)
以下是我的.ts文件中的代码:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { NotificationsPage } from '../notifications/notifications';
import { HomePage } from '../home/home';
import { MyPatientsPage } from '../my-patients/my-patients';
import { AllPatientsPage } from '../all-patients/all-patients';
import { LoginPage } …Run Code Online (Sandbox Code Playgroud) 我正在尝试按照这里的教程,但由于我使用的是较新版本的Angular和Ionic(Angular 5和Ionic 3),我在下面的这些行中出错了
this.token = data.token;
this.storage.set('token', data.token);
Run Code Online (Sandbox Code Playgroud)
Visual Studio代码显示此错误:
Property token does not exist on type 'Object'
该函数的代码如下:
createAccount(details){
return new Promise((resolve, reject) => {
let headers = new Headers();
headers.append('Content-Type', 'application/json');
this.http.post('https://YOUR_HEROKU_APP.herokuapp.com/api/auth/register', JSON.stringify(details), {headers: headers})
.subscribe(res => {
let data = res.json();
this.token = data.token;
this.storage.set('token', data.token);
resolve(data);
}, (err) => {
reject(err);
});
});
}
Run Code Online (Sandbox Code Playgroud)
我应该在代码中更改什么?
我是Ionic的新手并使用Ionic 3.9.2
我有几个终端命令来为我的离子应用程序提供服务,但是,这两个命令之间我没有任何区别.
ionic serve
Run Code Online (Sandbox Code Playgroud)
和
ionic serve -c
Run Code Online (Sandbox Code Playgroud) 我正在运行离子3应用程序时遇到这个奇怪的问题.我经历过这样的几个帖子,但没有人可以提供帮助.
以下是项目配置,
离子框架:3.9.2
离子应用程序脚本:3.1.11
角度核心:5.0.0
Angular Compiler CLI:5.0.0
节点:8.11.3
操作系统平台:Windows 10
导航器平台:Win32
这让我疯了.我将设备更新为IOS 12,将我的xcode更新为v10.当我尝试测试时,它会给我标题中的错误.
然后我插入了另一个使用ios 11的设备,并且在该设备中它启动时没有任何问题.
错误的图像
请帮帮我们 我已经尝试删除临时配置文件中的所有内容并从xcode下载手动配置文件,它仍然在ios 12上给出了这个错误.
ionic3 ×10
angular ×6
ionic2 ×4
typescript ×3
angularjs ×1
cordova ×1
ios12 ×1
javascript ×1
lazy-loading ×1
node.js ×1
xcode ×1