willmendesneto / ngx-feature-toggle Goto Github PK
View Code? Open in Web Editor NEWYour module to handle with feature toggles in Angular applications easier.
License: MIT License
Your module to handle with feature toggles in Angular applications easier.
License: MIT License
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
Current behavior
<ng-container *featureToggle="'TOGGLE_ENABLE_FEATURE_1_OF_2'">
<ng-container *featureToggle="'TOGGLE_ENABLE_FEATURE_1_OF_2'">
Show this content when both feature toggles are enabled
</ng-container>
</ng-container>
Expected behavior
<ng-container
*featureToggle="[
'TOGGLE_ENABLE_FEATURE_1_OF_2',
'TOGGLE_ENABLE_FEATURE_2_OF_2'
]"
>
Show this content when both feature toggles are enabled
</ng-container>
Reproduction of the problem
Not interesting.
What is the motivation / use case for changing the behavior?
Check two or more feature toggle once in template (with !
check too), exactly as in Route Guards.
Please tell us about your environment:
Not interesting.
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
Expected behavior
Prevent routing to component
If access to a component should be prevented when a feature is turned off. This can be accomplished by using the canActivate option available in Angular’s router.
What is the motivation / use case for changing the behavior?
I want to load only modules when a feature is turned on.
[ ] bug report => search github for a similar issue or PR before submitting
[ x] feature request
The FeatureToogleProvider is one directive, but we need load map features onLoad of application. The features are valid for all aplication.
Why set list features in HTML?
Please, can you create provider for load on module and, prefer, load rxJS features?
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[ x ] feature request
Current behavior
Now I have to copy paste the whole configuration for all possible environments.
Expected behavior
It would be nice to have an option to enable all features. For example I would develop a service which would return true every time for any feature name if the url of the loaded webpage is localhost. If the url is different the service would return the value for a given feature from the config object. If there is no value for that feature name, the service would return false.
Or I would like to have a button in the application "hide all development features" and after this button is clicked, my service would return false for any features, otherwise it would always return true for all the features. then I do not need the config object at all.
Summary - the API expects a config object always, this is too restrictive.
(maybe I misunderstood th API, if yes , then I am sorry)
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX |
Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (if applicable): node --version
=
I'm submitting a ...
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
Current behavior
We're using a feature toggle to show or hide a section in a form. We're implementing OnInit
to add the form group in its parent one.
Expected behavior
We would expect that the component's ngOnInit
method would not get called at all like it would happen if we used instead a ngIf
directive.
Reproduction of the problem
What is the motivation / use case for changing the behavior?
The component is not rendered as expected, but nothing related to an inner component life cycle should be called at all.
Please tell us about your environment:
ng serve
);Browser: Tested on all major browsers available on Windows: Chrome, Firefox, Edge (+ Opera)
Language: Typescript
Node (if applicable): Probably not applicable, but node --version = 8.11.1
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
Current behavior
const routes = [
{
path: "to/feature/toggle",
canActivate: [NgxFeatureToggleCanActivateGuard],
data: {
featureToggle: ["TOGGLE_ENABLE_FEATURE_1"],
},
},
];
Expected behavior
const routes = [
{
path: "to/feature/toggle",
canActivate: [NgxFeatureToggleCanActivateGuard],
data: {
featureToggle: ["TOGGLE_ENABLE_FEATURE_1"],
redirectTo: "to/feature/toggle/not/enabled",
},
},
];
Reproduction of the problem
Not interesting.
What is the motivation / use case for changing the behavior?
Redirect a user in a specific route when it tries to access in a route with a CanActivate/CanActivateChild/CanLoad Feature Toggle Guard.
Idea Brainstorming:
Please tell us about your environment:
Not interesting.
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
Current behavior
angular 9
Expected behavior
Upgrade to angular 13
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
Current behavior
Expected behavior
If featuretoggle name which is using in sub components is not listed in provider data, either it should notify or it has to generate compile time error. It should not disable the feature.
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX |
Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (if applicable): node --version
=
Update to Angular 14
I'm submitting a bug report (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
Current behavior
Uncaught Error: Template parse errors:
Can't bind to 'featureToggleService' since it isn't a known property of 'feature-toggle-provider'
Expected behavior
Should hide a button when feature-toggle is false
Reproduction of the problem
Just follow https://github.com/willmendesneto/ngx-feature-toggle/blob/master/README.md .
use ngx-feature-toggle(4.0.0)
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Operating system: Ubuntu 14.04
Language: [TypeScript 2.3.4, angular 4]
Node (if applicable): node --version
= v6.10.0
npm --version
= 3.10.10
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] improvement request
Current behavior
Currently we are using Travis-CI for our automated checks, but it's not flexible. After investigate some options Circle-CI is a good one for some reasons:
Workflow
concept, which is similar to Build Pipelines approach. We can have some benefitis in this approach, such as run tasks in parallel;To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.nvmrc
with the new onepackage.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
I'm submitting a ... (check one with "x")
[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
Current behavior
Nothing! The FeatureToggleProvider ignore featureToggleService=RxJS (subscribe)
Expected behavior
Listening RxJS (subscribe) and use data response.
Reproduction of the problem
Partial HTML
<feature-toggle-provider [featureToggleService]="featureService.getAllFeatures()"></feature-toggle-provider>
<feature-toggle [featureName]="'categoria'">
<button type="button" class="btn btn-danger btn-sm" (click)="excluirCategoria(categoria)">
<i class="fa fa-remove"></i>
</button>
</feature-toggle>
MyComponent and MyService (RxJS)
export class CategoriaHomeComponent implements OnInit {
constructor(private featureService: FeatureService) { }
...
}
export class FeatureService {
constructor(private http: HttpClient) {
}
public getAllFeatures(): Observable<any> {
return this.http.get<any>(API_URL + '/features');
}
public get(key: String): Observable<Boolean> {
return this.http.get<Boolean>(API_URL + '/features/' + key);
}
}
I'm submitting a ... (check one with "x")
Current behavior
Currently, all given feature toggles must be fulfilled. I'd like to have the option if any of the feature properties is fulfilled.
Currently, the AND behavior enforces to deactivate all not required features, like the following:
export const MY_ROUTE: Route = {
path: "my",
canActivate: [NgxFeatureToggleRouteGuard],
loadChildren: () => import(/* webpackChunkName: "my-chunk" */ "./../components/my/my.module").then(lazyModule => lazyModule.MyModule),
data: {
featureToggle: [
"!C", "!D"
]
}
};
As the list of feature toggle grows, this list must be touched again to exclude new feature-toggle (f.e. "!E").
=> I suggest to support besides the AND behavior also the OR behavior
Expected behavior
I'd like to have a featureOrToggle like this:
export const MY_ROUTE: Route = {
path: "my",
canActivate: [NgxFeatureToggleRouteGuard],
loadChildren: () => import(/* webpackChunkName: "my-chunk" */ "./../components/my/my.module").then(lazyModule => lazyModule.MyModule),
data: {
featureToggleOr: [
"A", "B"
]
}
};
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Avoid code changes in feature -> it's not mandatory to exclude further features
Please tell us about your environment:
Branch | Build failing 🚨 |
---|---|
Dependency | @angular/material |
Current Version | 2.0.0-beta.7 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As @angular/material is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.
I recommend you give this issue a high priority. I’m sure you can resolve this 💪
@angular/cdk
(component dev kit)! This package containscore/
have been moved for a11y/
, bidi/
,coercion/
, observe-content/
, platform/
, portal/
. The @angular/material
package now<cdk-table>
(the core) and the<md-table>
(with Material Design styles). See the documentation on material.angular.io for more<md-paginator>
and <md-sort-header>
components, which can be used either<md-table>
or any other table.@angular/material
and @angular/cdk
are now strict null compliant.@angular/material
now depends on @angular/cdk
as a peer dependency.| null
or | undefined
for strict null compatibility. IfObservable
. If your appThere is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot 🌴
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
Current behavior
n/a
Expected behavior
n/a
Reproduction of the problem
n/a
What is the motivation / use case for changing the behavior?
It would be nice if the toggle states were monitored and the element could show/hide depending on that state.
i.e element x is visible, API call goes off and returns a 503, then element x is not visible
Please tell us about your environment:
n/a
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
n/a
Language: [all | TypeScript X.X | ES6/7 | ES5]
Node (if applicable): node --version
=
I'm submitting a ... (check one with "x")
Current behavior
When you configure home page to have path = '', and use NgxFeatureToggleRouteGuard with redirectTo = '', redirect does not happen.
Expected behavior
Redirect to route where path = ''.
Reproduction of the problem
Use this snippet in your app routing module:
const ROUTE_DATA = {
redirectTo: '', // home page
featureToggle: [
'FlagName'
]
};
const ROUTES: Routes = [
{
path: '',
component: HomePageComponent,
pathMatch: "full"
},
{
path: 'Guard',
component: GuardedComponent,
canActivate: [NgxFeatureToggleRouteGuard],
data: ROUTE_DATA
}
];
What is the motivation / use case for changing the behavior?
Many apps set their home page with path = ''. This limitation prevents that design.
Please tell us about your environment:
OS: Windows
IDE: VS Code
NPM: 9.4.2
Browser: Chrome v110
Language: Typescript ES6
Node: 18.14.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.