-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Angular Cookbook
By :
In this recipe, you'll learn how to use value providers in Angular to provide constants and config values to your app. We'll start with the same example from the previous recipe, that is with the EmployeeComponent and AdminComponent using the BucketComponent to manage bucket of fruits. We will restrict the EmployeeComponent from deleting items from the bucket by using the configuration using value provider. As a result. the employees won't even see the Delete button.
The app that we are going to work with resides in start/apps/chapter03/ng-aliased-class-providers inside the cloned repository:
npm run serve ng-aliased-class-providers to serve the projectThis should open the app in a new browser tab and you should see the app as shown in Figure 3.11