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

How to get value from asynchronous local storage function and pass it to modal ionic 2
Syntax highlighting in Angular 2
angular2-cli cannot load style error
Angular2/Rxjs: 'catch' on observable giving ProgressEvent instead of json from response
Display items depending on date issued
Opening menu using position, angular2 material
Undefined is not an object(evaluating) - angular
Font Awesome with Ionic2
angular view is not updating after component value gets changed
how do I merge the values of the child components of angular2 into reactive form object?
Angular2 multiple components different imports
Update an array with new objects
Dropbox service with popup
Sending Emails Using TinyMce- Angular 2
Nested form tags in angular 2
Toggle Value in Angular Material CheckBox

Categories

HOME
c++
gradle
asynchronous
jsoup
hardware
google-speech-api
caffe
boost
import
post
q-learning
mutex
sublimelinter
gemfire
sorm
ccache
shoutem
angularjs-ng-transclude
fontforge
google-play-games
shogun
tablesorter
cognos-10
pixel
eventtrigger
divide-and-conquer
httpsession
cloudify
sqlanywhere
miktex
btrfs
graphic
mahapps.metro
jung
word
pam
angularjs-ng-model
nsubstitute
data-storage
automated-deployment
ole
reduce
xquery-sql
gitversion
jedi-vim
unicode-string
google-keep
ember-cli-mirage
playstation
hasownproperty
launch-agent
ldflags
jwrapper
dart-polymer
parrot
datepart
snap-lang
jquery-ui-resizable
togglz
johnny-five
payara
7digital
spatialite
eofexception
agsxmpp
ironscheme
cakedc
navigationbar
avaloq-script
function-prototypes
ember-qunit
accessdatasource
xcode6.1
syntactic-sugar
jform-designer
linq-to-lucene
texmacs
nsfontmanager
mic-1
aspnet-regiis.exe
jwebunit
icarousel
memory-profiling
rails-models
rakefile
trackback

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile