combining dust and angular: escaping curly brackets?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 461
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm trying to combine Dust (server-side) with Angular (client-side). Now Dust uses curly brackets {..}, whereas Angular uses double curly brackets {{ .. }}
I was hoping Dust would leave the double curly brackets alone, but it doesn't. So {{title}} is rendered as {} when "title" is not defined on the server side.
Instead it seems like the only way to render {{title}} is to escape these brackets by using {lb} and {rb}. In case of Angular twice, so the above becomes {lb}{lb}title{rb}{rb} -- which is really awful (a showstopper)
To handle this situation I'd like to propose an option that would make Dust ignore double curly brackets, such that one can just write {{title}}. Optional as forcing this may break existing Dust code.
I strongly favor a solution which allows to write Angular code without altering it, since that would allow people to simply take Angular existing Angular-html-code and drop it into a Dust template unchanged. And technically it seems to be feasible.
Thoughts anyone? Or perhaps any alternatives to what I'm trying to achieve?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how Dust parses curly-bracket expressions and how Angular interpolation uses double curly brackets. Define an optional behavior that preserves {{title}} for Angular while checking that existing Dust templates remain compatible; verify the result with representative server-side and client-side templates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, javascript
- Domain
- backend, frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100