下面的普朗克
@Input我在使用 Angular和时遇到问题inputs : ['']。
问题是我有一个person对象。该对象包含id( person.id)。现在我需要在“父”页面的构造函数中初始化它:(注意:针对 plunkr 进行了简化,不是实际代码,而是相同的问题)。
import { Component } from '@angular/core';
import { Child } from './child.ts';
@Component({
template: `
<p>current id: {{person.id}}</p>
<child-component [input_id]="person.id"></child-component>
`,
directives: [Child]
})
export class Parent {
public person: any;
constructor() {
//not neccessary here but it is for production
this.person = {id: -5, name: ''}
this.setPerson()
}
setPerson(){
//just to fake a async method (production will be http.get)
setTimeout(() …Run Code Online (Sandbox Code Playgroud) 所以,我正在尝试使用 tomcat v7.0 服务器。我已经使用了 tomcat v8.0 服务器,但是因为托管服务提供商不支持 tomcat v8.0,所以我需要创建一个 v7.0 项目。
但是当我尝试启动服务器时,会发生以下情况:
注意:我的 WEB-INF/lib 中没有 servlet-api.jar
Sep 29, 2015 8:59:15 AM org.apache.catalina.startup.Catalina start
SEVERE: The required Server component failed to start so Tomcat is unable to start.
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:691)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用自定义字体Quicksand创建一个应用程序(离子2).
我的文件夹结构如下所示:
src
|
|-app
| |
| -app
| | |
| | -app.scss
| |
| -pages
| |
| -assets
| | |
| | -img
| | |
| | -fonts
| | | |
| | | -Quicksand-Bold.ttf
Run Code Online (Sandbox Code Playgroud)
在我的app.scss我有以下代码,使我的所有页面中的字体可用:
@font-face {
font-family: 'Quicksand-Bold';
font-style: normal;
font-weight: 300;
src: local('Quicksand-Bold'), local('Quicksand-Bold'), url("../assets/fonts/Quicksand-Bold.ttf") format('woff2');
unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: 'Quicksand-Bold';
font-style: normal;
font-weight: 300;
src: local('Quicksand-Bold'), …Run Code Online (Sandbox Code Playgroud) 问题&&上下文
我得到了双倍的结果.表注册包含2列和2行event_id,participant_id有1,3和1,1.
现在,当我选择所有注册(select * from registration)时,这确实有效.
(firstname, lastname)2名参与者的姓名是('test' ,'test1')和('Gregor', 'unknown').
期望的结果
我想创建一个搜索功能,它只会返回为第一个或最后一个名字中带有'test'的事件注册它们的参与者.
目前的结果
通过下面的查询,我得到4个结果(所有参与者都是相同的).
select * from participant p, event e, registration r
where p.firstname LIKE '%test%'
OR p.lastname LIKE '%test%'
AND p.id = r.participant_id
AND e.id = r.event_id
AND e.id = 1;
Run Code Online (Sandbox Code Playgroud)
错误消息
none,只返回4行而不是1行.