feat(ncyBreadcrumbLast): add custom templating #133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add ability to set a custom
template
ortemplateUrl
forncyBreadCrumbLast
. Before, if a custom template that allowed HTML viangBindHtml
, breadcrumb last would not behave properly since it escapedHTML by default. A value could be assigned to the
ncyBreadcrumbLast
directive to customize the template, but it would have to be done on
each instance of the directive used. Now, a template can be set once via
the
templateLast
andtemplateLastUrl
properties of the configurationobject passed to
$breadcrumbProvider.setOptions
.A few things to point out:
ncyBreadcrumb
replaces the element the directive is set to, butncyBreadcrumbLast
does not. This means that the custom template that a user sets forncyBreadcrumbLast
will be wrapped by whatever element they added the directive to. This shouldn't be a huge problem, as it's the expected behavior today when assigning a custom value toncyBreadcrumbLast
.getTemplateLast
andgetTemplateLastUrl
, but I think it's probably the best way to go. I thought the added complexity of refactoring those functions for reusability was not worth it, considering they probably won't be used anywhere else. If you want those to be DRYer, let me know and I can do that.testLatest
version of angular to 1.4.9, instead of using the actual latest of 1.5.0. This is due to the fact that angular 1.5.0 causes tests to fail in master.Closes #123, Closes #125