ng-domain
v1.2.3
Published
Angular url and domain parsing service.
Maintainers
Readme
ng-domain
Angular: Url and domain name parser for components.
☝ Takes input as string list.
✌ Parses & searches url for input.
👌 Returns string(of your input) if found; returns 'd' as default (not found).
🖖 This variable can be used to designate domain-specific features in your component or html.
👇 Documentation & example below:
Install
yarn add ng-domainnpm install ng-domainComponent.ts
import { NgDomain } from 'ng-domain'
ngDomain: string
constructor(private nd: NgDomain) {
this.ngDomain = this.nd.getDomainKey(this.inputParam)
}Component.html
<style>
.yourInput button {
background-color: blue;
}
.d button {
background-color: red;
}
</style>
<div [ngClass]='ngDomain'>
{{ ngDomain }}
</div>