ngx-lib-nfq-button
v1.0.1
Published
A simple test of webcomponents in Angular
Downloads
3
Maintainers
Readme
NgxLibNfqButton
- A simple
component
library to be used with Angular. - This component extends the funtionality of Angular
web-components
and is recommended that it is used with it. - However, this component can be used inside
any other
component. - It is developed using
Angular >=8.0.0
and itsng g library
schematics.
Examples/Demo
- A simple Example can be found under
src/app
directory of this repository. It usesjson-server
to have a url and filter functionality.
Installation
npm i ngx-lib-nfq-button
API
import { ButtonModule } from 'ngx-lib-nfq-button';
selector: ui-button
@Inputs()
| Input | Type | Required | Description | | ---------------- | ------- | -------------------------- | --------------------------------------------------------------------------------------------------------- | | text | string | YES | the text to be displayed inside the button. | | disabled | boolean | Optional, default: false | if true, it disables the button |
Usage
- Register the
ButtonModule
in your app module.
import { ButtonModule } from 'ngx-lib-nfq-button'
import { NgModule } from '@angular/core';
import { ButtonModule } from 'ngx-mat-typeahead';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent],
imports: [
ButtonModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
- Use the selector inside any component html file
<ui-buton><ui-button>
in your component.
Running the example in local env inside your project
npm i
- Run
ng serve
for a dev server and running the demo app. Navigate tohttp://localhost:4200/
. The app will automatically reload if you change any of the source files. - The demo app uses
json-server
module for enabling the url and filter funtionality.