Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#7 Add possibility to pass custom template #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

simison
Copy link

@simison simison commented Feb 20, 2016

Closes #7

Defaults to template coming with this directive, but allows overwriting it:

<div sb-date-select template-url="custom-date-selector.html" ng-model="myModel"></div>

<script type="text/ng-template" id="custom-date-selector.html">
  <h4>Custom date selector template example</h4>
  <div class="sb-date-select">
    <select class="sb-date-select-day sb-date-select-select" ng-class="selectClass" ng-model="val.date" ng-options="d for d in dates track by d">
      <option value disabled selected>Day</option>
    </select>
    <select class="sb-date-select-month sb-date-select-select" ng-class="selectClass" ng-model="val.month" ng-options="m.value as m.name for m in months">
      <option value disabled>Month</option>
    </select>
    <select class="sb-date-select-year sb-date-select-select" ng-class="selectClass" ng-model="val.year" ng-options="y for y in years">
      <option value disabled selected>Year</option>
    </select>
  </div>
</script>

I didn't add documentation to Readme yet, but I can add it later if you think this is a good addition and merge #6 first.

Cheers! :-)

@HawkeyePierce89
Copy link

It's usefull PR!

@sambs can you agree this PR?

@@ -117,4 +125,3 @@ angular.module('sbDateSelect', [])
}
};
}]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need remove last empty line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants