1.0.0 • Published 9 years ago
@buildium/angular-launchdarkly-client v1.0.0
An AngularJS module for the LaunchDarkly Javascript SDK.
Getting Started
Installing
Available on NPM
npm install @buildium/angular-launchdarkly-clientUsage
After loading the script, add the module to your application dependencies
angular.module('myApp', ['buildium.launchdarkly-client', ...])Now you will have access to two services
LaunchDarklyClient is the LaunchDarkly SDK.
LaunchDarklyService exposes a service to retrieve feature flags.
function Controller(LaunchDarklyService) {
LaunchDarklyService.getFeatureFlag('myfeature', userId).then(function(isEnabled) {
// use flag
})
LaunchDarklyService.getFeatureFlag('myfeature').then(function(isEnabled) {
// use flag for anonymous user
})
}Before using the service it should be configured with a LaunchDarkly environment id.
.config(function(FeatureFlagServiceProvider) {
LaunchDarklyServiceProvider.setLaunchDarklyEnvironmentId(ENVIRONMENT_ID);
})Contributing
Running the tests
Tests are run with karma
npm testCompiling
npm run compileThis will generate the source file, index.js
License
Freely distributable under the terms of the MIT license.
1.0.0
9 years ago