Skip to content

Jeket/angular-shopping-flags

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Shopping Flags

A demo showcasing the use of feature flags in an e-commerce AngularJS app.

Built on top of Code Project's ShoppingCart, this Angular app uses LaunchDarkly feature flags to dynamically discount products in a webstore.

Feature Flags

Feature flags are served using LaunchDarkly's JavaScript SDK. In this app, we define a feature flag "store-discount" which can be toggled to return different numbers, indicating a store-wide discount.

Integrating

To integrate LaunchDarkly feature flags, we use Angular's $q to create a service which returns the feature flag client as a promise, which resolves when the client is ready to return flag variations. Then, the main store controller starts a listener. Whenever the store-discount flag is modified, the changes are detected, and new discounts are displayed to any user that may be viewing the store.

About

LaunchDarkly example app in Angular

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 59.4%
  • HTML 26.8%
  • CSS 12.8%
  • C# 1.0%