I would like to display {{ name }} string in Angular 2 template.
How do I disable template binding for part of template?
Add the ngNonBindable attribute to the tag, then Angular doesn't process bindings.
Plunker example
Update for Angular 4/5. Now, for printing { symbol inside angular template:
{{ '{' }}
ng serve out Error showing up the correct way
My package.json:
{
"name": "angular-client",
"version": "0.0.0",
"description": "My Angular Client",
"author": "noone",
"copyright": "",
"license": "UNLICENSED",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "^4.4.6",
"@angular/compiler": "^4.4.6",
"@angular/core": "^4.4.6",
"@angular/forms": "^4.4.6",
"@angular/http": "^4.4.6",
"@angular/platform-browser": "^4.4.6",
"@angular/platform-browser-dynamic": "^4.4.6",
"@angular/router": "^4.4.6",
"@angular/upgrade": "^4.4.6",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
"chart.js": "^2.5.0",
"core-js": "^2.4.1",
"file-saver": "^1.3.3",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"ng2-charts": "^1.5.0",
"ng2-currency-mask": "^4.3.1",
"ng2-slim-loading-bar": "^4.0.0",
"ngx-bootstrap": "^1.9.3",
"rxjs": "^5.3.0",
"stacktrace-js": "^2.0.0",
"ts-helpers": "^1.1.2",
"zone.js": "^0.8.8"
},
"devDependencies": {
"@angular/cli": "^1.0.2",
"@angular/compiler-cli": "^4.4.6",
"@types/jasmine": "^2.5.47",
"@types/node": "^7.0.13",
"codelyzer": "^2.1.1",
"jasmine-core": "^2.5.2",
"jasmine-spec-reporter": "^3.2.0",
"karma": "^1.6.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.0",
"karma-jasmine": "^1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.1.1",
"ts-node": "^3.0.2",
"tslint": "^4.5.1",
"typescript": "^2.2.2"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With