angularjs - Setting custom "view" text with select while maintaining the ability to set an object to ng-model -
With select
, if you enter an NG model with a value, it will be displayed That selected option
I have such an object:
start date: {views: "April 2014", month: 03, year: 2014} To select dates, with another object like this:
Initial: [[View: April - 2014 year: 2014 month: 3}, { View: May - 2014 Year: 2014 Month: 4}, {View: June - 2014 Year: 2014 Month: 5}, {View: July - 2014 Year: 2014 Month: 6} , {View: August - 2014 year: 2014 month: 7}, {View: SEP - 2014 year: 2014 month: 8}]
I have a statement that looks like this Is:
& lt; Ng- options = "date" date = "date_view =" start-date "ng-change =" millstust (date) "as date.view for date. & Lt; / Select & gt;
I should have a display startdate.view
but still allow to populate ng-model = "start date"
The object is selected.
I hope this is not a misleading question. Any help would be great.
You can find different options. Try to use:
& gt; Ng-model = "startDate" ng-option = "d.view for d in startdates" ng-change = "getStart (startdate)" & gt; ; / Select & gt;
Comments
Post a Comment