How to change default interpolation delimiter '{{' and '}}' to awesome emojis🤩 in Angular?

• Full Stack Engineer • Auth0Ambassador • Organizer at AngularHive community • Speaker • Blogger
Search for a command to run...

• Full Stack Engineer • Auth0Ambassador • Organizer at AngularHive community • Speaker • Blogger
Glad that you liked it. Thanks!
Hello awesome people👋, welcome back! In this post, I am going to walk you through how to set up Tailwind CSS in an Angular project. It is going to be the easiest setup you have ever done. Come on in. This post is for projects that are using Angular ...

Hello awesome people👋, welcome back. This blog post is going to be a super simple post, and I just wanna share my TailWind CSS learning with you all. What are we going to design? A simple and minimalistic card component with 100% TailWind CSS. Code...

Hello amazing people👋, welcome back! Introduction If you are from a Java background, you must have used/heard about Apache Tomcat server, which is a default server any Java developer works with to deal with Web app development. The landscape has cha...

Project documentation serves as a guide for new developers in a team. Why not create one for an Angular project?

Hello awesome people👋, welcome back!
This is again a super simple post about Angular, but pretty informative and you might have not read about it so far.
Let's begin.
Interpolation refers to embedding expressions or just variables into marked-up text in the Angular app.
By default, interpolation uses the double curly braces {{ and }} as delimiters.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'Hello World';
}
<!-- Hello World! -->
<span>{{ title }}!</span>
Angular allows to change the default delimiters {{ and }} to custom symbols/emojis.
All you need to do is add the interpolation option to @Component decorator in your App HTML (app.component.html) with custom start and end delimiters.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
interpolation: ['🤩', '🤩'],
})
export class AppComponent {
title = 'Hello World';
}
<!-- Hello World! -->
<span>🤩 title 🤩!</span>
Check out the demo on StackBlitz
All ready you now know how to change the default delimiters for text interpolation.
Hope you find this article useful, please feel free to share it with your friends/colleagues.
If you got any questions, don't hesitate to post them in the comments section down below.
Happy learning!
I tweet a lot about Web development, Java, and Productivity Hacks, follow me on Twitter at AskUdhay.
Here is one of my recent tweets:
https://angular.io/api/core/Component#interpolation