1.2.3 ā€¢ Published 3 years ago

ng-domain v1.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ng-domain

Angular: Url and domain name parser for components.

npm npm

ā˜ 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>

Give Ng-Domain a ā­ on github >

@snrou āœŒ