InterviewSolution
| 1. |
Which decorator creates services in Angular 2? |
|
Answer» The injectable DECORATOR in Angular 2 allows the functionality of the creation of a SERVICE to be injected and used in AngularJS modules by defining it as a PROVIDER in the Component Decorator. Following is a SYNTAX to successfully create a service using the Injectable() decorator Exampleimport { Injectable } from '@angular/core'; |
|