angular


ng-bootstrap Datepicker current date like placeholder


I use ng-bootstrap Datepicker something like here: plnkr example
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd"
name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker">
<div class="input-group-addon" (click)="d.toggle()" >
<img src="img/calendar-icon.svg" style="width: 1.2rem; height: 1rem; cursor: pointer;"/>
</div>
</div>
and I would like have placeholder as current date instead yyyy-mm-dd.
For example today 23.10.2016.
It is possible or how can i do that.
You can do like this-
In component, defined date like this-
valuedate = new Date();
In template html, change placeholder like this-
placeholder="{{valuedate | date: 'yyyy-MM-dd'}}"
Result:

Related Links

Angular 2 hide/show template
Angular 2 RC1 - Auto import all used components inside a base component
Add Lodash to VS2015 Angular2 Project
cannot find module errors after upgrading to angular-2.0.0-rc.4
Angular 2 don't dectect change on an Observable
Convert date in format accepted by restService
Reset forms in Angular2
Angular 2 - App Component Protect
GetSentry RavenJS not importing in webpack build
Wait for Angular 2 to load/resolve FormBuilder/ControlGroups before rendering view/template
Angular2 CanActivate from beta to current RC3
Rxjs: Why this stream of array not recieving new values
Page transitions in Angular 2
Base64 image with charset=utf-8; not displayed in Ionic2
Getting a wrong object through behavior suject
How to create complex(nested) JSON object in typescript in Angular2

Categories

HOME
web
lucene
ruby-on-rails-4
datastax
netfilter
interaction
sapply
m3u8
benchmarking
cllocationmanager
batch-normalization
bit-manipulation
zillow
gulp-sass
apprtcdemo
swtbot
django-channels
filepicker.io
oracle-data-integrator
messagebox
postgresql-8.3
hipchat
python-tesseract
street-address
appery.io
yamldotnet
powerdesigner
web.py
ngrx-effects
youtube-analytics
google-nearby
android-auto
inline
android-optionsmenu
cartography
xunit.net
lpc
spectral-density
ikvm
django-compressor
unicode-string
csla
vorlon
munin
cscore
ch
agile-project-management
throttle
idfa
spawn-fcgi
phpinfo
jquery-widgets
zend-studio
listboxitem
distinct-on
merit-gem
dynamic-ip
kirby
t4-toolbox
code-completion
date-arithmetic
compiler-options
worksite-sdk
image-manipulation
uploadifive
vtune
class-relationship
wtl
workbench
teamsite
impactjs
teamcity-7.1
declarative-services
opendocument
dynamic-html
where-in
node-http-proxy
gideros
amber-smalltalk
circusd
dotfuscator
trusted-timestamp
ejbql
clang-complete
custom-view
nexus-7
contentflow
scopes
hibernate-annotations
language-theory
dynamic-css
white-box-testing
urldecode
remote-administration

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App