A library for interpolation based on abstract syntax tree (AST) parsers of Angular 2. For more information read the blog Angular 2 - Interpolation service.
- Inject the service
InterpolationService
- Call the method
interpolate
with a format string and an object to be used for replacement of the placeholders
// returns 'Hello World!'
interpolation.interpolate('Hello {{placeholder}}', { placeholder: 'World!'});
The interpolation service is written in Typescript and has to be transpiled to Javascript.
- Execute
npm install
- Execute
npm run build
Running tests
- Execute
npm install
- Execute
npm run test
Look at code coverage after running tests
- Execute
npm run coverage-server