我需要在我的angular 2项目中使用这个JS库
这个问题可能与我重复,但没有答案对我有用
我试图在我的index.html页面中将库作为脚本标记包含在内
它总是看不到它http:// localhost:8100/PrayTimes.js文件不存在
我也在上面写了这段代码
declare var PrayTimes:any;
Run Code Online (Sandbox Code Playgroud)
我试图在我的构造函数中使用它,但我收到此错误
PrayTimes未定义
我在申请表上有一份登记表.但在此注册表格中,有一个可选的"密码"和"重复密码"输入.因为我宁可不使用FormControl
对象来检索这些2个值(其他值都很好),我想为使用的一种解决方法ngModel
中的<form>
TS:
public password: string = '';
public passwordRe: string = '';
public registrationForm;
constructor(public fb: Formbuilder) {
this.registrationForm = this.fb.group({
'firstname' : [null, Validators.required],
'lastname': [null, Validators.required]
});
}
Run Code Online (Sandbox Code Playgroud)
HTML
<form [formGroup]="registrationForm" (ngSubmit)="doSomething()">
<div class="form-group"
[ngClass]="{'has-error':!registrationForm.controls['firstname'].valid
&& registrationForm.controls['firstname'].touched}">
<label>Firstname: *</label>
<input class="form-control" type="text" placeholder="Firstname" [formControl]="registrationForm.controls['firstname']"/>
</div>
<div class="form-group"
[ngClass]="{'has-error':!registrationForm.controls['lastname'].valid
&& registrationForm.controls['lastname'].touched}">
<label>Lastname: *</label>
<input class="form-control" type="text" placeholder="Lastname" [formControl]="registrationForm.controls['lastname']"/>
</div>
<!-- NG MODELS -->
<input type="password" [(ngModel)] = "password"/>
<input type="password" [(ngModel)] = "passwordRe" …
Run Code Online (Sandbox Code Playgroud) 我从angular2和ionic2开始;
在ionic2中,我有一个按钮,可以调用我的组件的方法.像这样:
<button secondary clear large>
</button>
Run Code Online (Sandbox Code Playgroud)
我应该使用(click)
- angular2 OR (tap)
- ionic2?
像这样:
(click)
<button secondary clear large (click)="pause()">
</button>
Run Code Online (Sandbox Code Playgroud)
(tap)
<button secondary clear large (tap)="pause()">
</button>
Run Code Online (Sandbox Code Playgroud)
有一些区别吗?您可以(tap)
在
http://ionicframework.com/docs/v2/components/#gestures中看到
谢谢.
我不想在问题/答案中建议使用angular2-bootstrap或ng2-bs3-modal Angular 2 Bootstrap Modal 和Angular 2.0 and Modal Dialog
现在.我知道什么打开和关闭引导模式.
display: none;
和之间切换display: block;
div
之间aria-hidden="true"
并aria-hidden="false
所以,我自然认为如果我这样绑定aria-hidden
属性[aria-hidden]="true"
,我就可以操纵它.可悲的是,我不能约束,aria-hidden
因为它不是一个已知的属性div
.(注意,attr.aria-hidden
不存在)
我知道这可以用JQuery实现$('#myModal').modal()
如下问题所示如何使用jQuery打开一个Bootstrap模式窗口?
所以我的问题是,是否有一个TypeScript功能modal()
与JQuery 做同样的事情,或者有没有办法将函数/变量绑定到aria-hidden
?
我目前html
:
<div id="createAccountModal" class="modal fade customForm" role="dialog" [aria-hidden]="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4>Create account</h4>
</div>
<div class="modal-body">
<p>Lorem ipsum</P>
</div>
<div class="modal-footer align-left">
My custom footer
</div>
</div> …
Run Code Online (Sandbox Code Playgroud) 我一直在研究JDK 9的Jigsaw模块化系统.
从命令行编译时(至少快速启动),它工作得非常好.
但我正在尝试使用Spring和Jigsaw创建一个简单的REST API.据说Spring 5.0.0 M1有
截至2016年7月,与JDK 9完全兼容
我还希望REST API能够与Maven一起使用.根据这个Maven页面,Maven应该能够使用Java 9(或者我读错了吗?).
当我的JAVA_HOME指向我的JDK时,我似乎无法mvn spring-boot:run
在我的Spring Boot应用程序上运行- 它会引发很多异常,例如:
FoundError: javax/xml/bind/ValidationException
2016-09-14 10:43:42.704 ERROR 120408 --- [ main] o.s.boot.SpringApplication : Application startup failed
Run Code Online (Sandbox Code Playgroud)
跑步mvn -version
给了我:
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\Program Files\apache-maven-3.3.9\bin\..
Java version: 9-ea, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-9
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
Run Code Online (Sandbox Code Playgroud)
目前是否可以使用Jigsaw使用Spring和Java 9创建此REST API?或者我应该坚持Java …
如何将日期从页面"转移"到side-menu
Ionic2中,即 - 具有app.page.html
以下内容:
<ion-menu [content]="content">
<ion-content class="menu-left">
<!-- User profile -->
<div text-center padding-top padding-bottom class="primary-bg menu-left">
<a menuClose>
<h4 light>{{userName}}</h4>
</a>
</div>
<ion-list class="list-full-border">
<button ion-item menuClose *ngFor="let page of pages" (click)="openPage(page)">
<ion-icon item-left name="{{ page.icon }}"></ion-icon>
{{ page.title }}
<ion-badge color="danger" item-right *ngIf="page.count">{{ page.count }}</ion-badge>
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
Run Code Online (Sandbox Code Playgroud)
如何userName
根据数据从页面中的操作更新值facebookLogin.page
?
facebookLogin.page.ts
:
...
fbLogin() {
Facebook.login(["public_profile", "email"])
.then((resp: FacebookLoginResponse) => {
if (resp.status === "connected") { …
Run Code Online (Sandbox Code Playgroud) 我正在努力更好地了解ionic2
和ionic3
.
垃圾收集如何在离子中起作用?
就像在这张图片中看到的那样(来源):
当进入新页面时,一些内存获得G.C'd.然而,记忆仍然显着高于任何视频播放前的记忆.
我怎样才能获得Kotlin数据类的列表declaredFields
呢?像Java一样getDeclaredFields()
如果这是可能的,还可以过滤public
和private
字段?(像Java一样Modifier.isPrivate(field.getModifiers())
)
我在Ionic2应用程序中配置OAuth时遇到问题.我没有在OAuth的前端部分使用任何框架/库.
问题是我401: Unauthorized: Invalid signature
每次尝试检索access_token都会得到一个.(向下滚动代码,用注释缩进问题)
现在我的服务器被设置为三脚OAuth应用程序(如此处所述).这意味着将有3个端点:
/request_token
(这个有效)请求(GET参数):
oauth_version : ...
oauth_nonce: ....
oauth_timestamp: ...
oauth_consumer_key: ...
oauth_signature_method: ...
oauth_signature: ...
Run Code Online (Sandbox Code Playgroud)
响应:
oauth_token: .... (temporary)
oauth_token_secret: ....
Run Code Online (Sandbox Code Playgroud)
/authorize
(这个也有效 - >打开浏览器进行身份验证)请求(GET参数):
oauth_token: ....
oauth_callback: ....
Run Code Online (Sandbox Code Playgroud)
响应
oauth_token: ....
oauth_verifier: ...
Run Code Online (Sandbox Code Playgroud)
/access_token
(这个不起作用)请求(GET参数)
oauth_token: ....
oauth_verifier: ....
oauth_version : ...
oauth_nonce: ....
oauth_timestamp: ...
oauth_consumer_key: ...
oauth_signature_method: ...
oauth_signature: ...
Run Code Online (Sandbox Code Playgroud)
响应:
oauth_token: .... (permanent)
oauth_secret: ....
Run Code Online (Sandbox Code Playgroud)
最后一个不起作用,虽然我signatureBaseString
以相同的方式设置并根据指南设置键 …
版本:Cordova:6.3.1,Gulp CLI:1.2.2,离子框架:2.0.0-rc.0,Ionic CLI版本:2.1.0
我在ionic2应用程序中使用ng2-charts.
进口不受import {ChartsModule} from "ng2-charts";
而是import {ChartsModule} from "ng2-charts/components/charts/charts;"
因为这个(问题#440)
我的整个app.module.ts
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { ChartsModule } from 'ng2-charts/components/charts/charts';
import { MyApp } from './app.component';
import { EventsPage } from '../pages/events/events.component';
import { ChartComponent } from '../pages/chart/chart.component';
import { APICaller } from '../services/APICaller.service';
import { EventDetailComponent } from '../pages/event-detail/event-detail.component';
import { ParticipantDetail } from '../pages/participant-detail/participant-detail.component';
import { ParticipantFeedComponent } from …
Run Code Online (Sandbox Code Playgroud) angular ×7
ionic2 ×6
ionic3 ×4
typescript ×4
java ×2
javascript ×2
click ×1
java-9 ×1
kotlin ×1
maven ×1
ng2-charts ×1
oauth ×1
reflection ×1
rest ×1
spring ×1
tap ×1