我正在构建一个 angular2/typescript 应用程序。我看到 google 推出了platform.js,它可以访问 gapi var,如google 登录网站上所示。这很好用,但我在将它输入打字稿时遇到了很多麻烦。
TS 依赖 .d.ts 文件来导入 javascript。谷歌推出的新gapi是否有任何打字稿绑定?有这个版本的gapi来自绝对类型/gapi,但它已经过时了。
我考虑过为 google js 编写自己的类型定义,但我只能找到 google 提供的缩小版本。
如果新的 google 登录没有 tsd 绑定,我如何仍将其与打字稿一起使用?我试图将 js 文件保存到我的本地,然后执行类似的操作,
var gapi = require('../../js/lib/gapi');
但这对我不起作用,无论我如何尝试使用 javascript 导入。
我正在尝试实现angular2反应形式,但在加载组件时出现运行时错误
Uncaught TypeError: Cannot set property stack of [object Object] which has only a getter
这个错误并不完全清楚,所以我很难弄清楚发生了什么.我跟着一篇有条理的大学文章.我想也许有一些重大变化,所以我检查了angular2更改日志,但没有发现任何与我的问题有关的反应形式.
任何帮助将在这里受到赞赏.我将继续寻找解决方案.
addevent.component.ts
@Component({
selector: 'addevent',
templateUrl: 'addevent.component.html',
styleUrls: ['addevent.scss']
})
export class AddEvent {
// vars
private _addEventForm:FormGroup;
private _eventTitle:FormControl;
private _eventDescription:FormControl;
constructor(private _addEventService:AddEventService,
private _formBuilder:FormBuilder) {
// init vars
this. _eventTitle = new FormControl('', Validators.required);
this._eventDescription = new FormControl('', Validators.required);
this._addEventForm = _formBuilder.group({
'eventTitle': this._eventTitle,
'eventDescription': this._eventDescription
});
}
private addEvent():void {
console.log(this._addEventForm);
//this._addEventService.addEvent();
}
}
Run Code Online (Sandbox Code Playgroud)
addevent.component.html
<div class="h3 content-title">Add Event</div> …Run Code Online (Sandbox Code Playgroud) 我正在尝试进行gitlab-ci构建,但是在mysql安装程序部分遇到了问题。当我提交时,mysql脚本似乎可以正常运行,但是在连接数据库时,应用程序构建失败。我在这里想念什么?
.gitlab-ci.yml
stages:
- prepare
- test
services:
- mariadb
variables:
MYSQL_ROOT_PASSWORD: "password"
connect:
stage: prepare
image: mysql
script:
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mariadb < "data/db/scripts/create-db.sql"
- mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host=mariadb < "data/db/scripts/init-db-tables.sql"
dev:
stage: test
image: java:opendjdk-8
script:
- ./gradlew assemble
- ./gradlew check
Run Code Online (Sandbox Code Playgroud)
数据源配置
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUrl("jdbc:mysql://mariadb:3306/rvep");
dataSource.setUsername("root");
dataSource.setPassword("password");
dataSource.setDriverClassName("com.mysql.jdbc.Driver");
return dataSource;
}
Run Code Online (Sandbox Code Playgroud)
编译错误 导致的休眠配置未命中数据库
io.abnd.rvep.RVEPTests > contextLoads FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.BeanInstantiationException
Caused …Run Code Online (Sandbox Code Playgroud)