Skip to content

Commit f10cbe9

Browse files
authored
Merge pull request coreui#10 from damingerdai/develop
Develop
2 parents 24f26f4 + dd8da67 commit f10cbe9

File tree

5 files changed

+8010
-4
lines changed

5 files changed

+8010
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
其功能与core ui基本一致,存在部分改动:
99
1. 改造项目结构,使用angular官方推荐的项目结构
1010
2. 添加toastr组件(该相似组件仅在Core UI收费版提供,免费版不提供)
11+
3. 添加首屏渲染
1112

1213
# 下一步计划
13-
1. toaster组件添加使用angular2-toaster
14+
1. toaster组件添加使用angular2-toaster(已经完成)
1415
2. 修复dashboard组件中的bug
1516
```
1617
ERROR Error: No value accessor for form control with unspecified

src/app/routes/notifications/toastr/toastr.component.html

+28
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,34 @@
2828
</div>
2929
</div>
3030
<!--/.col-->
31+
<div class="col-lg-12">
32+
<toaster-container [toasterconfig]="config"></toaster-container>
33+
<div class="card">
34+
<div class="card-header">
35+
<i class="fa fa-align-justify"></i>Angular2-Toaster
36+
<div class="card-header-actions">
37+
<a href="https://github.com/stabzs/Angular2-Toaster" class="card-header-action" target="_blank">doc</a>
38+
</div>
39+
</div>
40+
<div class="card-body">
41+
<!-- <button type="button" class="btn btn-primary mr-1" (click)="showPrimary2()">
42+
Try primary
43+
</button> -->
44+
<button type="button" class="btn btn-success mr-1" (click)="showSuccess2()">
45+
Try success
46+
</button>
47+
<button type="button" class="btn btn-warning mr-1" (click)="showWarn2()">
48+
Try warning
49+
</button>
50+
<button type="button" class="btn btn-danger mr-1" (click)="showDanger2()">
51+
Try danger
52+
</button>
53+
<button type="button" class="btn btn-info mr-1" (click)="showInfo2()">
54+
Try info
55+
</button>
56+
</div>
57+
</div>
58+
</div>
3159
</div>
3260
<!--/.row-->
3361
</div>

src/app/routes/notifications/toastr/toastr.component.ts

+54-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
22
import { ToastrService } from 'ngx-toastr';
3-
import { ToasterService } from 'angular2-toaster';
3+
import { ToasterService, ToasterConfig } from 'angular2-toaster';
44

55
@Component({
66
selector: 'app-toastr',
@@ -9,6 +9,13 @@ import { ToasterService } from 'angular2-toaster';
99
})
1010
export class ToastrComponent implements OnInit {
1111

12+
config: ToasterConfig =
13+
new ToasterConfig({
14+
showCloseButton: true,
15+
tapToDismiss: false,
16+
timeout: 0
17+
});
18+
1219
constructor(
1320
private toastr: ToastrService,
1421
private toasterService: ToasterService
@@ -38,6 +45,52 @@ export class ToastrComponent implements OnInit {
3845
this.toastr.info('Hello world!', 'Toastr fun!');
3946
}
4047

48+
showPrimary2() {
49+
// this.toasterService.pop('primary', 'Hello world!', 'Toastr fun!');
50+
this.toasterService.pop({
51+
type: 'primary',
52+
title: 'Hello world!',
53+
body: 'Toastr fun!',
54+
timeout: 10000
55+
});
56+
}
57+
58+
showSuccess2() {
59+
this.toasterService.pop({
60+
type: 'success',
61+
title: 'Hello world!',
62+
body: 'Toastr fun!',
63+
timeout: 10000
64+
});
65+
}
66+
67+
showWarn2() {
68+
this.toasterService.pop({
69+
type: 'warning',
70+
title: 'Hello world!',
71+
body: 'Toastr fun!',
72+
timeout: 10000
73+
});
74+
}
75+
76+
showDanger2() {
77+
this.toasterService.pop({
78+
type: 'error',
79+
title: 'Hello world!',
80+
body: 'Toastr fun!',
81+
timeout: 10000
82+
});
83+
}
84+
85+
showInfo2() {
86+
this.toasterService.pop({
87+
type: 'info',
88+
title: 'Hello world!',
89+
body: 'Toastr fun!',
90+
timeout: 10000
91+
});
92+
}
93+
4194
ngOnInit() {
4295
}
4396

tools/yarn/check-yarn.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
'use strict';
1010

1111
if (process.env.npm_execpath.indexOf('yarn') === -1) {
12-
throw new Error(
13-
'Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/');
12+
// throw new Error(
13+
// 'Please use Yarn instead of NPM to install dependencies. See: https://yarnpkg.com/lang/en/docs/install/');
1414
}

0 commit comments

Comments
 (0)