How to implement feature flag in angular

preview_player
Показать описание
The feature flag refers to a concept that we are going to provide a system in our project that checks whether our features are enabled/disabled, it's an awesome technique that allows teams to test features before accomplishing their development.

timestamps:
0:00 intro
0:19 what is feature-flag?
1:23 describing the basic changes in the project
3:04 rendering modules based on feature activeness
6:14 feature flag directive
12:59 feature guard
20:05 outro

Thanks for visiting programming with Hamid.
btw u can find the project source code from the below section:

Рекомендации по теме
Комментарии
Автор

If you use an object instead of an array for your features (you probably don't have repeat features), you don't need to use find and iterate over your environment.features all the time. O(1) vs O(n)

codypotter
Автор

The modern way to create the guard and directive is to just make them standalone. The guard can be a CanActivateFn (see the angular docs for CanActivateFn) its easier than this.

`ng g d feature-flag --standlaone` creates the feature flag directive without the need for the module.

codypotter
Автор

I wonder how you got your work to run as is! It shouldn't... it can't. You're missing adding your directive properly.

mohsenmadi
welcome to shbcf.ru