Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(filters): add trim filter #15080

Closed
wants to merge 2 commits into from

Conversation

austinoneil
Copy link
Contributor

@austinoneil austinoneil commented Sep 1, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

feature

What is the current behavior? (You can also link to an open issue here)

There is no trim filter. This feature was in response to Issue #15018.

What is the new behavior (if this is a feature change)?

There is a built-in trim filter.

Does this PR introduce a breaking change?

no

Please check if the PR fulfills these requirements

Other information:

add trim filter. Motivation: issue #15018 requests PRs.

add trim filter. Motivation: issue 15018 requests PRs.
remove trailing space caught by travis ci
@petebacondarwin
Copy link
Contributor

@austinoneil thanks for sending this in. Trim is an easy filter to create but we don't want to add more of this sort of stuff to the core library. Instead it should be a 3rd party module that people can install if needed. See http://ngmodules.org/

@petebacondarwin
Copy link
Contributor

I think that @gkalpak was not suggesting that we add it to the core but that one could make one's own trim filter to clean up his example.

@austinoneil
Copy link
Contributor Author

For future reference, what does the "PRs plz!" tag mean?

@petebacondarwin
Copy link
Contributor

@austinoneil your assumption was correct that PRs plz! suggests that we would like people to put together a PR for an issue. In this case the request, if I understand it correctly, was to fix the currency filter to do the trimming automatically. Perhaps @gkalpak and @wesleycho could clarify?

@wesleycho
Copy link
Contributor

I don't think this PR is relevant to the discussion in #15018 - that discussion was specifically about the currency filter and a particular string there being trimmed due to certain locales. One can create such a filter like this in a user's app, but this type of filter shouldn't be in core.

Instead, what I suggested was that perhaps within the currency filter the relevant string be trimmed so that the issue in particular locales would not have an extra space at the end of the string.

@gkalpak
Copy link
Member

gkalpak commented Sep 7, 2016

@petebacondarwin is right. I did not suggest we created a trim filter in core. In order to adrress #15018 (in core), we need to "incorporate" some trimming into currencyFilter. That is what the PRs plz! label refers to.

Introducing a trim filter was suggested as one of the possible workarounds for people to avoid this issues until this is properly fixed in core (by fixing currencyFilter) - not as something to be introduced in core.

Sorry, for the confusion, @austinoneil 😞 (I'll try to clarify this a bit more in #15018).

@austinoneil
Copy link
Contributor Author

austinoneil commented Sep 7, 2016

yeah, I made a new pull request. where the currency string gets trimmed, rather than adding a trim filter to the core.

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

Successfully merging this pull request may close these issues.

5 participants