Skip to content

Commit fe3576e

Browse files
committed
''
1 parent 88aa42f commit fe3576e

File tree

16 files changed

+69
-56
lines changed

16 files changed

+69
-56
lines changed

angular-10/src/app/component/alert/alert.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class NgbdAlertBasicComponent implements OnInit {
4949
private _success = new Subject<string>();
5050

5151
staticAlertClosed = false;
52-
successMessage: string;
52+
successMessage: string='';
5353

5454
public closeAlert(alert: IAlert) {
5555
const index: number = this.alerts.indexOf(alert);
@@ -64,7 +64,7 @@ export class NgbdAlertBasicComponent implements OnInit {
6464
setTimeout(() => (this.staticAlertClosed = true), 20000);
6565

6666
this._success.subscribe(message => (this.successMessage = message));
67-
this._success.pipe(debounceTime(5000)).subscribe(() => (this.successMessage = null));
67+
this._success.pipe(debounceTime(5000)).subscribe(() => (this.successMessage = ''));
6868
}
6969

7070
public changeSuccessMessage() {

angular-10/src/app/component/buttons/buttons.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { FormBuilder, FormGroup } from '@angular/forms';
44
templateUrl: 'buttons.component.html'
55
})
66
export class ButtonsComponent {
7-
public checkboxGroupForm: FormGroup;
7+
public checkboxGroupForm: FormGroup=Object.create(null);
88

9-
public radioGroupForm: FormGroup;
9+
public radioGroupForm: FormGroup=Object.create(null);;
1010

1111
constructor(private formBuilder: FormBuilder) {}
1212

angular-10/src/app/component/carousel/carousel.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ export class NgbdCarouselBasicComponent {
2020

2121
config.showNavigationArrows = true;
2222
config.showNavigationIndicators = true;
23+
24+
2325
}
2426
paused = false;
2527
unpauseOnArrow = false;
2628
pauseOnIndicator = false;
2729
pauseOnHover = true;
2830

29-
@ViewChild('carousel', {static : true}) carousel: NgbCarousel;
31+
@ViewChild('carousel', {static : true}) carousel: NgbCarousel=Object.create(null);
3032

3133
togglePaused() {
3234
if (this.paused) {

angular-10/src/app/component/datepicker/datepicker.component.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ const after = (one: NgbDateStruct, two: NgbDateStruct) =>
6767
]
6868
})
6969
export class NgbdDatepickerBasicComponent {
70-
model: NgbDateStruct;
71-
model4: NgbDateStruct;
70+
model: NgbDateStruct=Object.create(null);
71+
model4: NgbDateStruct=Object.create(null);
7272

73-
model2;
74-
date: { year: number; month: number };
73+
model2:NgbDateStruct=Object.create(null);
74+
date: { year: number; month: number }=Object.create(null);
7575

7676
// Custom date adapter
77-
model1: Date;
78-
model11: Date;
77+
model1: Date=Object.create(null);
78+
model11: Date=Object.create(null);
7979

8080
// footer
81-
model5: NgbDateStruct;
81+
model5: NgbDateStruct=Object.create(null);;
8282
today5 = this.calendar5.getToday();
8383

8484
get today() {
@@ -95,7 +95,7 @@ export class NgbdDatepickerBasicComponent {
9595
disabled = true;
9696

9797
// This is for the range date picker
98-
hoveredDate: NgbDateStruct;
98+
hoveredDate: NgbDateStruct=Object.create(null);
9999

100100
fromDate: NgbDateStruct;
101101
toDate: NgbDateStruct;
@@ -115,15 +115,15 @@ export class NgbdDatepickerBasicComponent {
115115
} else if (this.fromDate && !this.toDate && after(date, this.fromDate)) {
116116
this.toDate = date;
117117
} else {
118-
this.toDate = null;
118+
this.toDate = Object.create(null);;
119119
this.fromDate = date;
120120
}
121121
}
122122

123-
isHovered = date => this.fromDate && !this.toDate && this.hoveredDate && after(date, this.fromDate) && before(date, this.hoveredDate);
124-
isInside = date => after(date, this.fromDate) && before(date, this.toDate);
125-
isFrom = date => equals(date, this.fromDate);
126-
isTo = date => equals(date, this.toDate);
123+
isHovered = (date:NgbDate) => this.fromDate && !this.toDate && this.hoveredDate && after(date, this.fromDate) && before(date, this.hoveredDate);
124+
isInside = (date:NgbDate) => after(date, this.fromDate) && before(date, this.toDate);
125+
isFrom = (date:NgbDate) => equals(date, this.fromDate);
126+
isTo = (date:NgbDate) => equals(date, this.toDate);
127127
isDisabled = (date: NgbDate, current: { month: number }) => date.month !== current.month;
128128
isWeekend = (date: NgbDate) => this.calendar1.getWeekday(date) >= 6;
129129
}

angular-10/src/app/component/modal/modal.component.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import { NgbModal, ModalDismissReasons, NgbActiveModal } from '@ng-bootstrap/ng-
66
templateUrl: './modal.component.html'
77
})
88
export class NgbdModalBasicComponent {
9-
closeResult: string;
9+
closeResult: string='';
1010

1111
constructor(private modalService: NgbModal) {}
1212
// This is for the first modal
13-
open1(content1) {
13+
open1(content1:string) {
1414
this.modalService.open(content1, {ariaLabelledBy: 'modal-basic-title'}).result.then((result) => {
1515
this.closeResult = `Closed with: ${result}`;
1616
}, (reason) => {
1717
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
1818
});
1919
}
2020
// This is for the Second modal
21-
open2(content2) {
21+
open2(content2:string) {
2222
this.modalService.open(content2, {ariaLabelledBy: 'modal-basic-title'}).result.then((result) => {
2323
this.closeResult = `Closed with: ${result}`;
2424
}, (reason) => {
@@ -28,37 +28,37 @@ export class NgbdModalBasicComponent {
2828

2929
// This is for the Third varios modal options
3030

31-
openBackDropCustomClass(content3) {
31+
openBackDropCustomClass(content3:string) {
3232
this.modalService.open(content3, {backdropClass: 'light-blue-backdrop'});
3333
}
3434

35-
openWindowCustomClass(content3) {
35+
openWindowCustomClass(content3:string) {
3636
this.modalService.open(content3, { windowClass: 'dark-modal' });
3737
}
3838

39-
openSm(content3) {
39+
openSm(content3:string) {
4040
this.modalService.open(content3, { size: 'sm' });
4141
}
4242

43-
openLg(content3) {
43+
openLg(content3:string) {
4444
this.modalService.open(content3, { size: 'lg' });
4545
}
4646

47-
openVerticallyCentered(content3) {
47+
openVerticallyCentered(content3:string) {
4848
this.modalService.open(content3, { centered: true });
4949
}
5050

51-
openstackmodal(contentstack) {
51+
openstackmodal(contentstack:string) {
5252
this.modalService.open(contentstack, {size: 'lg'});
5353
}
5454

5555

56-
opensubmodal(contentsubmodal) {
56+
opensubmodal(contentsubmodal:string) {
5757
this.modalService.open(contentsubmodal, {size: 'lg'});
5858
}
5959

6060

61-
private getDismissReason(reason: any): string {
61+
private getDismissReason(reason: ModalDismissReasons): string {
6262
if (reason === ModalDismissReasons.ESC) {
6363
return 'by pressing ESC';
6464
} else if (reason === ModalDismissReasons.BACKDROP_CLICK) {

angular-10/src/app/component/pagination/pagination.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class NgbdpaginationBasicComponent {
1111
currentPage = 3;
1212
disablepage = 3;
1313
isDisabled = true;
14-
pagecustom: 4;
14+
pagecustom=4;
1515
toggleDisabled() {
1616
this.isDisabled = !this.isDisabled;
1717
}

angular-10/src/app/component/popover-tooltip/popover-tooltip.component.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
2+
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap';
23

34
@Component({
45
selector: 'app-ngbd-popover-tooltip',
@@ -22,14 +23,16 @@ import { Component, ViewChild, ViewEncapsulation } from '@angular/core';
2223
]
2324
})
2425
export class NgbdPopTooltipComponent {
25-
greeting = {};
26+
greeting:object = {};
2627

2728
name = 'World';
28-
lastShown: Date;
29-
lastHidden: Date;
30-
@ViewChild('p', { static: true }) public popover;
29+
lastShown: Date=new Date();
30+
lastHidden: Date=new Date();;
3131

32-
public changeGreeting(greeting: any): void {
32+
@ViewChild('p', { static: true }) public popover:any;
33+
34+
public changeGreeting(greeting: NgbTooltip): void {
35+
debugger;
3336
const isOpen = this.popover.isOpen();
3437
this.popover.close();
3538
if (greeting !== this.greeting || !isOpen) {
@@ -38,7 +41,7 @@ export class NgbdPopTooltipComponent {
3841
}
3942
}
4043

41-
toggleWithGreeting(tooltip, greeting: string) {
44+
toggleWithGreeting(tooltip:NgbTooltip, greeting: string) {
4245
if (tooltip.isOpen()) {
4346
tooltip.close();
4447
} else {

angular-10/src/app/component/toast/toast-container.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ import { ToastService } from './toast.service';
2525
export class ToastsContainer {
2626
constructor(public toastService: ToastService) {}
2727

28-
isTemplate(toast) { return toast.textOrTpl instanceof TemplateRef; }
28+
isTemplate(toast:{title:string}) {
29+
debugger;
30+
return toast.title;
31+
}
2932
}

angular-10/src/app/component/toast/toast.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class ToastComponent {
2727
this.toastService.show('I am a success toast', { classname: 'bg-success text-light', delay: 10000 });
2828
}
2929

30-
showDanger(dangerTpl) {
30+
showDanger(dangerTpl:string) {
3131
this.toastService.show(dangerTpl, { classname: 'bg-danger text-light', delay: 15000 });
3232
}
3333
}

angular-10/src/app/component/toast/toast.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { Injectable, TemplateRef } from '@angular/core';
22

33
@Injectable({ providedIn: 'root' })
44
export class ToastService {
5-
toasts: any[] = [];
5+
toasts: Array<string> = [];
66

77
show(textOrTpl: string | TemplateRef<any>, options: any = {}) {
88
this.toasts.push({ textOrTpl, ...options });
99
}
1010

11-
remove(toast) {
11+
remove(toast:string) {
1212
this.toasts = this.toasts.filter(t => t !== toast);
1313
}
1414
}

0 commit comments

Comments
 (0)