这似乎是一个简单的问题.我在Ionic 2应用程序中使用管道作为日期格式.这是收到的webservice响应.
[
{
"MessageID": 544882,
"CategoryID": 1,
"DateSent": "2015-05-18T02:30:56",
"Title": "Jobseeker App",
"MessageContent": "Hi Test guy just started to use the app..",
"Sender": null,
"Recipient": null,
"DateReceived": null,
"DateRead": "2015-05-18T02:30:56",
"Note_Direction": "sent",
"Viewed": 0,
"AppointmentDateTime": null,
"MessageAttachments": [
]
},
{
"MessageID": 544886,
"CategoryID": 1,
"DateSent": "2015-05-18T02:42:45",
"Title": "Jobseeker App",
"MessageContent": "App",
"Sender": null,
"Recipient": null,
"DateReceived": null,
"DateRead": "2015-05-18T02:42:45",
"Note_Direction": "sent",
"Viewed": 0,
"AppointmentDateTime": null,
"MessageAttachments": [
]}
]
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的代码片段.
<div class="Date">
<label class="time">{{appointment.DateSent | date:"HH"}}:{{appointment.DateSent| date:"mm"}}</label>
<label …Run Code Online (Sandbox Code Playgroud) 我试图在我的搜索栏中自动完成我到目前为止所做的事情.
我有一个带有一些字符串的数组.然后我试图在我的项目中列出我能够搜索特定项目.
但我的要求是不要在列表中显示项目.我必须单击搜索栏,所有数组中的字符串应该来,我必须进行搜索.
<ion-header>
<ion-navbar>
<ion-title>search</ion-title>
</ion-navbar>
<ion-toolbar primary >
<ion-searchbar (ionInput)="getItems($event)" autocorrect="off"></ion-searchbar>
</ion-toolbar>
</ion-header>
<ion-content padding>
<ion-list>
<ion-item *ngFor="let item of items">
{{ item }}
</ion-item>
</ion-list>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
search.ts文件的代码:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
/*
Generated class for the SearchPage page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
templateUrl: 'build/pages/search/search.html',
})
export class SearchPage {
private searchQuery: string = '';
private items: string[];
constructor(private navCtrl: NavController) { …Run Code Online (Sandbox Code Playgroud) 我正在尝试在浏览器上运行离子项目,但默认端口8000已在使用中.
我需要改变端口
我正在使用此命令:
ionic run browser --port 8002
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
该文件说,port 选项是--port | -p
谢谢
我对Ionic框架很新.
按照文档我创建了一个像这样的搜索栏:
<ion-searchbar
[(ngModel)]="searchQuery"
[showCancelButton]="true"
(ionInput)="search($event)">
</ion-searchbar>
Run Code Online (Sandbox Code Playgroud)
ionInput当搜索栏输入已更改(包括已清除)时.
这按预期工作.
但是我想要一个不同的行为.我不想在search($event)每次输入更改时触发,但是当用户点击"输入"键或单击按钮时,我找不到发出的输出事件.
这种行为有解决方案吗?
建立在一些优秀的标准Ionic 2掠夺者的基础上http://plnkr.co/edit/ZsoPeE?p=preview和 http://plnkr.co/edit/WBeRRJyYucLwvckjh5W7?p=preview
你能帮我调整我的Master/Detail Plunker吗?我以为我已经把所有部件都放在了一边,但因为它产生了白色屏幕而丢失了一些东西.
这是我对Master/Detail插件的尝试 http://plnkr.co/edit/7NHIYMA3TUdd5nOkoXyF?p=preview
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { AppComponent } from './app.component';
import { HomePage } from '../pages/home/home';
import { MasterPage } from '../pages/master/master';
import { DetailPage } from '../pages/detail/detail';
import { Sheetsu } from '../providers/sheetsu';
@NgModule({
imports: [ IonicModule.forRoot(AppComponent) ],
declarations: [ AppComponent, HomePage, MasterPage, DetailPage],
entryComponents: [ HomePage, MasterPage, DetailPage ],
bootstrap: [ IonicApp ],
providers: [ Sheetsu ]
})
export class …Run Code Online (Sandbox Code Playgroud) 我创建了一个Ionic 2侧面菜单项目,并在VS 2015中完成了Ionic 2所需的所有安装.但是在运行项目时它仍然有这个消息:
你差不多准备好了!如果您看到此页面,则仍需要为Visual Studio安装NPM Task Runner扩展,然后再次运行此应用程序.您可以从以下网址下载扩展程序:https://aka.ms/ctmhio
我从网站上安装了NPM Task Runner,但仍然显示消息.我尝试在安装后重启VS而没有运气.
我正试图在我的Ionic 2应用程序中使用ThreeJS实现一个非常基本的动画.基本上是试图旋转立方体.但是多维数据集不会旋转,因为requestAnimationFrame只在render循环中执行一次.
没有旋转动画.我在下面分享我的代码.
home.html的
<ion-header>
<ion-navbar>
<ion-title>
Ionic Blank
</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<div #webgloutput></div>
</ion-content>
Run Code Online (Sandbox Code Playgroud)
home.ts
import { Component, ViewChild, ElementRef } from '@angular/core';
import { NavController } from 'ionic-angular';
import * as THREE from 'three';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
@ViewChild('webgloutput') webgloutput: ElementRef;
private renderer: any;
private scene: any;
private camera: any;
private cube: any;
constructor(public navCtrl: NavController) {
}
ngOnInit() {
this.initThree();
}
initThree() {
this.scene = new THREE.Scene();
this.camera = …Run Code Online (Sandbox Code Playgroud) 我有一个简单的聊天界面,但当我对输入文本区域进行聚焦时,键盘会推动所有内容,包括标题.内容区域的最顶层内容也隐藏了,我无法向上滚动到它们.
这仅适用于ios.
<ion-header></ion-header>
<ion-content>
Chat Title...
Chat Messages...
</ion-content>
<ion-footer>
<ion-card class="chat-input">
<textarea appAutoresize class="chat-input-textarea" rows="1" [(ngModel)]="input" placeholder="Ihre Nachricht"></textarea>
</ion-card>
</ion-footer>
Run Code Online (Sandbox Code Playgroud) 我将Cordova和Ionic Native插件安装到ionic3项目中.
但我需要完全从项目中删除特定的Cordova和Ionic Native插件.(具有依赖性npm).
有没有正确的方法呢?
感谢您的任何帮助.
谢谢!
ionic2 ×10
angular ×5
ionic3 ×2
browser ×1
cordova ×1
date-format ×1
javascript ×1
keyboard ×1
three.js ×1
typescript ×1
zoom ×1