130 likes | 218 Views
Angular is a full-fledged JavaScript framework for front-end develpoment. This video on Angular Services explains the feature of having to write a common code for multiple components in the application. Angular Services could include certain methods, functions or variables that are used by multiple files. In this video, the following topics are covered: <br><br>1. Why Angular Services?<br>2. What are Angular Services? <br>3. Features of Angular Services<br>4. Hands-on tutorial on Angular Services<br><br>About Simplilearn Angular training course:<br>This Angular Certification Training Course will help you master front-end web development with Angular. Gain in-depth knowledge of concepts like facilitating the development of single-page web applications, dependency injection, typescript, components, and directives with this Angular Course.<br><br>Simplilearnu2019s Angular certification course helps you understand the design of single-page applications and how Angular facilities their development. This Angular certification provides knowledge of concepts such as TypeScript, Bootstrap Grid System, dependency injections, SPA, forms, pipes, promises, observables, and Angular class testing.<br><br>Angular Course Key Features<br>1. 100% Money Back Guarantee<br>2. 50 hours of blended learning<br>3. Three industry-based projects and 12 quizzes<br>4. Free introductory JavaScript course<br>5. Flexibility to choose classes<br><br>ud83dudc49Learn more at: https://bit.ly/2Druybm<br>
E N D
Why Angular Services? Logo component Sign-in component Image component Create-account component
Why Angular Services? Sign-in component Logo component Consider all these components performing common tasks like accessing the database, rendering images on the view, etc. Image component Create-account component
Why Angular Services? Click here to watch the video
Why Angular Services? Sign-in component Logo component Image component Create-account component • To avoid rewriting of code, Angular Services are used • A service can be written once and injected into all the components that use that service • A Service could be a function, variable or a feature that an application needs.
What Are Angular Services? Comp1 Comp2 App Service Comp3 • Normally, components are used to ensure a good user experience • In order to execute tasks, using Services is ideal • A component can delegate tasks like fetching data from the server, validating user input, or logging directly to the console to the Service • These tasks can be made available to any component in the app
Features of Angular Services Decorated with @Injectibe They share the same piece of code A Service is a Class Hold the business logic Services are singleton Registered on modules or components Share data among components Interact with the backend
DEMO Use case- Create employee details such as name, employee ID and email ID. Click on the employee button to retrieve an employee’s data Add the location for the employees in the list