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

When bundling using systemjs-builder. At runtime i get an unable to get property 'prototype' of undefined or null reference
Issues with ng2-charts
Cordova media plugin is not working in marshmallow
Is Angular2 responsive out of the box?
Async call update HTML Element though Angular 4.x Service
Uncaught ReferenceError: define is not defined angular2/webpack 1
unable to find suitable angular data grid for angular 2.4.1 version?
Access process.env in environment.ts file created from the angular-cli
Cannot read property 'channels' of undefined youtube api
How to set the public path on angular 4
Using local Bootstrap3 with angular 2
Firebase: update database when no write operation happens in 5 minutes interval
Build single directive to perform both Structural & Attribute behaviour?
Angular 2 Sending data to child
AOT - Function calls are not supported Module.forRoot
subscribe to ionic page change event

Categories

HOME
c++
linux-kernel
machine-learning
momentjs
magento-1.9
datastax
refactoring
web-crawler
umbraco7
attributes
visual-studio-mac
contiki
sublimelinter
facebook-live-api
glusterfs
tensorboard
ieee-754
directive
angularjs-ng-transclude
logstash-grok
prefix
jxmaps
spring-boot-actuator
sirikit
google-login
pad
uiinterfaceorientation
ddos
nodemon
side-effects
choropleth
grunt-connect-proxy
puma
bluehost
tensorflow-serving
regex-negation
layer
tornado-motor
nsdate
submenu
crossfilter
leanft
r6
redhat-bpm
cachemanager
lift
dreamhost
model-driven
jenkinsfile
keyword-search
singleton-type
android-device-monitor
itunes-store
google-truth
nsfontpanel
canvas-lms
tivoli-identity-manager
showdown
android-gson
istanbul
c#-to-vb.net
data-transfer
greenlets
nsoutlineview
android-runtime
imshow
pubsubhubbub
mechanize
dex2oat
nokia
archiving
ubuntu-15.10
datepart
test-and-target
typing
grid-layout
nscoding
jquery-widgets
lg
divider
eclipse-emf-ecore
ooyala
meter
wordpress-4.5
euclidean-distance
bitarray
beta-testing
ms-query
ekeventstore
savefiledialog
ncbi
centura
like
uploadifive
facade
jsqlparser
restriction
webproxy
numpad
datacontext
sine-wave
pyro
mashup
texmacs
nsfontmanager
firepad
wsimport
alpha-five
struts-config
.lrc
expandoobject
pasteboard
cck
windows-2000
visual-programming
xla
comdlg32
pdc2008

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