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

Angular 2: Select dropdown not selecting option despite “selected” attribute
angular2 singleton alternative
Angular2 terrible performance with ngFor assigning variable to “index”
nav.popToRoot() showing blank screen
Anguler2 js: getting no compatible version found : #types/node#^5.8.0
Angular 2 xi18n cannot resolve template path outside of component directory
Angular 2 - Uncaught (in promise): ReferenceError: System is not defined
update routes dynamically in angular2 app
Resolving Multiple Pieces of Data using Resolve Guard in Angular 2
Angular 2 disable form button from ts?
ng2-charts - Can't bind to 'datasets' since it isn't a known property of 'base-chart'
Angular 2 not showing correctly values in input
Webpack resolve.modulesDirectories doesn't seem to work
Text editors in angular2
Where can i find the latest ionic-angular2 version in a plunker that uses #Ngmodule?
How to manually lazy load a module?

Categories

HOME
angular
okta
sails.js
recaptcha
ruby-on-rails-4
custom-attributes
datatable
windows-forms-designer
jaxb
aurelia-router
soundcloud
geometry
sorm
outlook-redemption
wmi-query
fix
watchkit
filenet-p8
cognos-10
atlassian-sourcetree
sdl
google-login
beatbox
derivative
zillow
bootstrap-select
django-channels
apl
dsolve
provider
uilabel
asp.net-mvc-routing
get-eventlog
opensaml
submenu
crossfilter
lightgallery
angularjs-ng-model
hana-cloud-platform
angular2-http
cachemanager
sphero-api
bspline
watchdog
sencha-architect
spring-cloud-sleuth
azure-sql-server
jquery-ui-widget-factory
strconv
webpack-style-loader
jquery-ui-tabs
fuzzy
doubly-linked-list
google-keep
bubble-sort
ember-cli-mirage
asana-connect
visual-c++-2013
leshan
orphan
flowgear
display-bugs
nsthread
idfa
grid-layout
oslo
simplify
highcharts-ng
iterm
mongoose-web-server
execution-time
yard
mpld3
materialized-views
savefiledialog
gamma-function
date-arithmetic
compiler-options
mongojs
centura
file-attributes
linux-capabilities
wtl
apache-tomee
jml
facade
impactjs
application-integration
freetextbox
topcoat
postfix-operator
node-http-proxy
graphml
icommand
asp.net-compiler
ios6.1
jquery-ui-selectable
ipad-2
phonetics
ext-direct
wymeditor
in-app
codeigniter-datamapper
endl
kiln
mahjong
executequery
live-cd
urldecode

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