1.2.3 ā¢ Published 3 years ago
ng-domain v1.2.3
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-domain
npm install ng-domain
Component.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>