-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(timepicker): transform input props to config props only
- Loading branch information
Showing
10 changed files
with
18 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
<timepicker [(ngModel)]="myTime" [useUtc]="useUtc"></timepicker> | ||
|
||
<div class="row my-3"> | ||
<div class="col-xs-6 col-6 col-md-4"> | ||
<button type="button" class="btn btn-info" (click)="useUtc = !useUtc">useUtc: {{useUtc}}</button> | ||
</div> | ||
</div> | ||
<timepicker [(ngModel)]="myTime"></timepicker> | ||
|
||
<pre class="alert alert-info">Time is: {{myTime}}</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
import { Component } from '@angular/core'; | ||
import { TimepickerConfig } from 'ngx-bootstrap/timepicker'; | ||
|
||
export function getTimepickerConfig(): TimepickerConfig { | ||
return Object.assign(new TimepickerConfig(), { | ||
useUtc: true | ||
}); | ||
} | ||
|
||
@Component({ | ||
// eslint-disable-next-line @angular-eslint/component-selector | ||
selector: 'demo-timepicker-use-utc', | ||
templateUrl: './use-utc.html' | ||
templateUrl: './use-utc.html', | ||
providers: [{ provide: TimepickerConfig, useFactory: getTimepickerConfig }] | ||
}) | ||
export class DemoTimepickerUseUtcComponent { | ||
myTime: Date = new Date(); | ||
useUtc = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters