Skip to content

feat(change_detection): make INTERPOLATE_REGEXP customizable#7417

Merged
mhevery merged 1 commit intoangular:masterfrom
lacolaco:laco-inject-interpolate-regexp
May 26, 2016
Merged

feat(change_detection): make INTERPOLATE_REGEXP customizable#7417
mhevery merged 1 commit intoangular:masterfrom
lacolaco:laco-inject-interpolate-regexp

Conversation

@lacolaco
Copy link
Copy Markdown
Contributor

@lacolaco lacolaco commented Mar 4, 2016

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • 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)
    The pattern for interpolation is not able to modify. INTERPOLATE_REGEXP is a variable and is referred in Parser directly.
  • What is the new behavior (if this is a feature change)?
    Add new public api, INTERPOLATE_REGEXP, which allows us customize interpolation regexp pattern. (for Python Jinja and more template languages).
    Similar api is in AngularJS as $interpolateProvider.

And Parser takes the pattern for interpolation from DI.

@lacolaco lacolaco force-pushed the laco-inject-interpolate-regexp branch 3 times, most recently from 061eaac to 32ce118 Compare March 4, 2016 04:28
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The compiler should not be configured via DI but rather via a new field on CompilerConfig (a new class that replaces ChangeDetectorConfig once you rebase).

@tbosch
Copy link
Copy Markdown
Contributor

tbosch commented May 26, 2016

Need a rebase as well.

@tbosch tbosch added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label May 26, 2016
@lacolaco lacolaco force-pushed the laco-inject-interpolate-regexp branch from 32ce118 to c9be63a Compare May 26, 2016 02:03
@lacolaco
Copy link
Copy Markdown
Contributor Author

lacolaco commented May 26, 2016

I've rebased but then new feature's tests were dropped.
I'll add tests in parser_spec.ts.

@lacolaco lacolaco force-pushed the laco-inject-interpolate-regexp branch from c9be63a to a1de09c Compare May 26, 2016 02:21
@lacolaco
Copy link
Copy Markdown
Contributor Author

New approach: CompilerConfig.interpolateRegexp as new constructor optional argument.

new CompilerConfig(true, true, true, null, /<<([\s\S]*?)>>/g)

BREAKING CHANGES:

`Parser` constructor required new parameter `config: CompilerConfig` as second argument.
@lacolaco lacolaco force-pushed the laco-inject-interpolate-regexp branch from 5276bf1 to 5d13e48 Compare May 26, 2016 03:02
@mhevery mhevery merged commit c3fafa0 into angular:master May 26, 2016
vicb added a commit to vicb/angular that referenced this pull request Jun 2, 2016
…ngular#7417)"

This reverts commit c3fafa0.

The symbols should be configured at the component level and not be global to the compiler.
@lacolaco lacolaco deleted the laco-inject-interpolate-regexp branch July 7, 2018 06:38
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: Compatible API to $interpolateProvider.startSymbol, endSymbol

5 participants