greatCodeIdeas / md-date-range-picker

Angular Material Date Range Picker Service/Directive
MIT License
62 stars 40 forks source link

open mdDateRange instead of mdDateRangePicker #38

Closed ashishyadav0019 closed 6 years ago

ashishyadav0019 commented 6 years ago

Is there a way to open "mdDateRange" on button click or any other event (the one that opens in md-menu). instead of "mdDateRangePicker" (this one open in md-dialog)?

the documentation only has work around for "mdDateRangePicker"

$scope.selectDateRange = function () {
  $mdDateRangePicker.show({
    model: $scope.serviceModel,
  }).then(function (result) {
    $scope.serviceModel = result;
  }).catch(function () {
    console.log('Cancelled');
  }
}
this on opens in dialog box...

but i want the one that opens in md-menu to open on my event

md-dialog md-menu

Please help.. Thanks in advance

roelbarreto commented 6 years ago

Try something like this https://jsfiddle.net/xvc93tgs/1/ Or just put some css on the md-date-range button/input

ashishyadav0019 commented 6 years ago

Thanks it just the thing i wanted.... I was trying to execute $mdOpenMenu($event) form out side of.... mdMenuthat's the reason I failed.

Thanks a lot... Made my day