Closed vishnu-vv closed 6 years ago
At some point the dateStart and dateEnd are filled after any digest event
$rootScope.selectedRange = {
selectedTemplate: 'L30D',
selectedTemplateName: 'Last 30 Days',
}
// Option 1 wait for any diggest
$timeout(function(){
// You can do something with the binded value here
console.log($rootScope.selectedRange.dateStart, $rootScope.selectedRange.dateEnd);
});
or get the mdOnSelect event
<md-date-range md-on-select="handleOnSelect()" ng-model="selectedRange"></md-date-range>
$rootScope.handleOnSelect = function(){
// do something with here to retrieve model computed values
console.log( $rootScope.selectedRange)
}
Hope this helps
See this attachment. @ipiz
Sorry I dint understand the first question, I'll make a fix for this one
@ipiz That was awesome 👍
I want
Last 30 Days
to be selected by default. Something like this: