我正在使用 ion-select => ion-option 作为我的 ionic 3 项目的输入。它在选择时发出警报,但是警报正文的字体大小非常小,我尝试了所有 sass 选项来增加其字体大小,但徒劳无功。我试过使用.alert-md, .alert-tappable. 有什么办法可以增加这种字体。
.scss
.ios, .md {
page-add-stock {
/*.alert-md .alert-checkbox-label{
}*/
.alert-radio-label {
font-size: 3rem;
}
}
}
Run Code Online (Sandbox Code Playgroud)
.html
<ion-select [(ngModel)]="category" formControlName="category" >
<ion-option>Pesticides</ion-option>
<ion-option>Seeds</ion-option>
<ion-option>Herbicides</ion-option>
<ion-option>Fertilizers</ion-option>
<ion-option>Farming tools</ion-option>
</ion-select>
Run Code Online (Sandbox Code Playgroud)
生成警报的 Html 离子选择,以防万一。
我正在使用AlertControllerionic 3实现一个警报对话框,如下所示
let alert = this.alertCtrl.create({
title: 'Low battery',
subTitle: '10% of battery remaining',
buttons: ['Dismiss']
});
alert.present();
Run Code Online (Sandbox Code Playgroud)
这个警报对话框在谷歌地图上方可见,但我无法点击这个警报按钮,任何点击警报对话框的点击仍然被视为我点击它下面的谷歌地图。即使在地图上方显示警报对话框,我仍然可以像往常一样与地图交互,我可以单击地图中的任何标记,我可以放大、缩小。
假设我有一个客户花费了大量时间和金钱来创建自定义数据库。因此需要额外的数据安全性。他们担心如果他们允许从普通 Web 应用程序访问数据库中的信息,可能会被刮掉。安全登录是不够的;有人可以登录然后抓取数据。就像任何其他 Web 应用程序一样,PWA 不会对此提供保护。
我的总体意见是,在必须安装的混合应用程序上,敏感数据会得到更好的保护。对于这个项目,我倾向于使用 React-Native 或 Ionic。
我错了吗?有没有办法保护数据不被 PWA 抓取?
我想写泛型pipe。这是pipe我为数据类型编写的地方Category
order-by-category.ts
import { Pipe, PipeTransform } from '@angular/core';
import { Category } from '../../models/Category';
import { sortBy } from 'lodash';
@Pipe({
name: 'orderByCategory',
})
export class OrderByCategoryPipe implements PipeTransform {
transform(value: Category[]): Category[] {
return sortBy(value, (o: Category) => { return o.name; });
}
}
Run Code Online (Sandbox Code Playgroud)
.html
<ion-item *ngFor="let c of categorySortedList | orderByCategory">
<ion-label>{{c.name }}</ion-label>
<ion-radio [value]="c.id" (ionSelect)="selectedCategory(c)"></ion-radio>
</ion-item>
Run Code Online (Sandbox Code Playgroud)
现在我需要编写相同类型的pipe. 但data type情况不同。
现在是这样的:
transform(value: BudgetGroup[]): BudgetGroup[] {
return sortBy(value, (o: …Run Code Online (Sandbox Code Playgroud) 运行命令“ionic cordova build android --prod”后出现以下错误。
Error: Metadata version mismatch for module C:/Users/newuser/Documents/project/project/node_modules/@ionic/storage/dist/src/storage.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:24474:34)
at StaticSymbolResolver._createSymbolsOf (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:24260:46)
at StaticSymbolResolver.getSymbolsOf (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:24241:14)
at C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:23023:30
at Array.forEach (<anonymous>)
at extractProgramSymbols (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:23022:79)
at AotCompiler.compileAll (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler\bundles\compiler.umd.js:22720:47)
at CodeGenerator.codegen (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler-cli\src\codegen.js:30:14)
at Function.NgTools_InternalApi_NG_2.codeGen (C:\Users\newuser\Documents\project\project\node_modules\@angular\compiler-cli\src\ngtools_api.js:61:30)
at Object.doCodegen (C:\Users\newuser\Documents\project\project\node_modules\@ionic\app-scripts\dist\aot\codegen.js:6:51)
Run Code Online (Sandbox Code Playgroud)
离子信息:
@ionic/cli-utils : 1.14.0
ionic (Ionic CLI) : 3.14.0
Run Code Online (Sandbox Code Playgroud)
全局包:
cordova (Cordova CLI) : 7.1.0
Run Code Online (Sandbox Code Playgroud)
本地包:
@ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.6.0
Run Code Online (Sandbox Code Playgroud)
系统:
Node : v8.9.0
npm …Run Code Online (Sandbox Code Playgroud) 我正在使用 Ionic 3,但我需要知道如何将 angular 依赖项从 5.0.0 降级到 4.3.3
"dependencies": {
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@ionic-native/core": "4.3.2",
"@ionic-native/splash-screen": "4.3.2",
"@ionic-native/status-bar": "4.3.2",
"@ionic/pro": "1.0.12",
"@ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
Run Code Online (Sandbox Code Playgroud) 我想在更改离子选项时传递员工 ID。我试过这个,但它不起作用,如果有任何错误,请告诉我这是我的代码:
<ion-label>Employee</ion-label>
<ion-select formControlName="employee">
<ion-option *ngFor="let employee of employees" (ionChange)="selectEmployee($event, employee)">{{ employee.FirstName + " " + employee.MiddleName + " " + employee.LastName }}</ion-option>
</ion-select>
Run Code Online (Sandbox Code Playgroud)
employee.ts 文件代码:
selectEmployee(event, employee)
{
alert(employee.EMP_ID);
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用简单的点击功能构建一个应用程序。我将处理程序添加到 users.html 页面中的按钮,应用程序会一直运行,直到我到达可以单击两个已处理按钮中的任何一个的页面。当我点击按钮时,我收到下面提到的错误,它不是一个函数。
我在 users.ts 文件中定义了 onLoadUser() 函数。类被导出。
技术
错误
目录结构
用户.html
<ion-header>
<ion-navbar>
<ion-title>The Users</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<button ion-button (click)="onLoadUser('Max')">User 'Max'</button>
<hr>
<button ion-button (click)="onLoadUser('Anna')">User 'Anna'</button>
</ion-content>
<ion-footer padding>
<p>The Footer</p>
</ion-footer>
Run Code Online (Sandbox Code Playgroud)
用户.ts
import { Component } from '@angular/core';
import { NavController } from "ionic-angular";
import { UserPage } from "./user/user";
@Component({
selector: 'page-users',
templateUrl: 'users.html'
})
export class UsersPage {
constructor (private navCtrl: NavController) {}
onLoadUser(name: string) {
this.navCtrl.push(UserPage, {userName: name});
}
} …Run Code Online (Sandbox Code Playgroud) 我想在 Ionic PWA 中显示来自 config.xml 的版本号。
使用 ionic 本机应用程序版本插件可以轻松完成 ios/android 构建。
但是什么是 PWA 构建的好方法(npm run build --release --prod)?
我正在使用 Visual Studio Code 来构建我的 ionic3 应用程序现在我想调试我的项目,但我看到了这个错误:[
cordova-tools] 处理“附加”时出错:错误:无法找到 adb。请确保它在您的 PATH 中并重新打开 Visual Studio Code
我怎样才能解决这个问题?
ionic3 ×10
angular ×5
ionic2 ×2
typescript ×2
google-maps ×1
react-native ×1
sass ×1
webpack ×1