angular


how to get the value of a custom element with angular 2


I have this, https://embed.plnkr.co/xXt9wKs7jzpaivQeLjbx/
the calendar is my custom component, but if I show
{{dateValue | date:"yyyy/MM/dd"}}
this is not getting the selected date I am choosing in my calendar.
How can I get this?
Add #Output property to your FxDatePickerComponent:
#Output() valueChange: EventEmitter<Date> = new EventEmitter();
then you can use two-way binding in template:
<fx-datepicker [(value)]="dateValue"></fx-datepicker>
Plunker Example
.Have you tried somethng like:
in your (app.component.html) HTML:
(dateModelChange)="countChange($event)"
In your TS (App.compoment.ts):
countChange(event){
this.dateValue=event;
}
Cuase you need to declare also the 'listener' to the #output property .. so you're right to declare :
#Output() dateModelChange: EventEmitter<Date> = new EventEmitter();
In your sub component .. but you'have also to declare a listener to it in the parent component

Related Links

Angular2 cannot use the values of a subscribe in another subscribe (observable)
Angular 2 Passing parameters to the template through #Input() [closed]
All declarations of 'size' , 'prototype' must have identical modifiers
Accessing the Device Camera without getUserMedia [closed]
Template Error on ngFor and using pipe with parameter
Angular 2: Validators.compose() vs [] [duplicate]
angular 2 -spring boot
VelocityJS in a TypeScript project throws '../node_modules/#types/velocity-animate/index.d.ts is not a module'
How to resubscribe to an observable?
Angular material 2 dynamic button toggle group form control accessor
Debug Tests in NG Test
Angular 2. Doubled custom tags
Integration Stripe Elements with angular 2
How to format phone number while typing in angular 2?
Angular: Wrap providers in a module?
Angular - getting the handle to the ng-content component in the parent

Categories

HOME
web
gradle
loadrunner
lucene
graphite
firmware
appium
umbraco7
g2o
get
animate.css
pygtk
uinavigationcontroller
netfilter
treeset
shogun
tablesorter
prestashop-1.6
jxmaps
j
beatbox
react-boilerplate
intercept
visualvm
miktex
filepicker.io
indexoutofrangeexception
messagebox
floyd-warshall
eureka-forms
wasapi
uppercase
crawler4j
direct3d9
devexpress-wpf
notnull
lighttable
paypal-adaptive-payments
orika
django-compressor
bisonc++
erlang-shell
sceditor
simplehttpserver
cscore
helium
report-viewer2012
dbx
parrot
correspondence-analysis
rouge
codeigniter-restserver
iis-8.5
nscoding
rebase
johnny-five
busy-waiting
avm2
sin
foundation
xamarin-forms
authentication-flows
sql-server-2008-express
qmediaplayer
interspire-shopping-cart
jquery-dropkick
typescript1.4
jml
webproxy
numpad
avassetwriter
styledtext
mapstraction
toplink
harfbuzz
divshot
perl-critic
agi
jvm-crash
opengl-es-1.1
system-design
nsformatter
texinfo
memory-profiling
python-sockets
entityreference
openflashchart2
httpverbs
showmodaldialog
progressive-enhancement
maintenance-plan
reverse-debugging
sqlmetal
testing-strategies
flashlite

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile