Skip to content

#7 Add possibility to pass custom template#10

Open
simison wants to merge 2 commits intosambs:masterfrom
simison:template-url
Open

#7 Add possibility to pass custom template#10
simison wants to merge 2 commits intosambs:masterfrom
simison:template-url

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?

}
};
}]);

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