0.0.1 • Published 7 years ago

ng-custom-title v0.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

ng-custom-title

Angular custom titles by @CrossEngage :)

How to use it

Instalation

first you need install the

  npm install ng-custon-title

Usage

Angular

Then you need inject the Custom Title to your app.module

import { NgCustomTitleModule } from '...path-to-module';

@NgModule({
  imports: [NgCustomTitleModule],
  providers: []
})

export class AppModule {
  ngDoBootstrap() {}
}

On your Angular Component you can add a value to be rendered and be editable ;)

import { Component } from '@angular/core';

@Component({
  selector: 'my-component',
  template: '...'
})

export class myComponent {
  myEditableTitle: string = 'Hi Guys!';

}

After that you need call the editable title component with one simple component declaration on HTML like:

  <ng-custom-title
    [title]="myEditableTitle"
    [placeholder]="'Section name'" 
    [error-text]="'Please enter name.'">
    (update)="myEditableTitle = $event">
  </ng-custom-title>
AngularJS

Well, are you still using AngularJS there? Don't worry! We made it fully compatible with AngularJS, so you only need follow this steps to use...

Then you need inject the Custom Title to your app.module

import { NgCustomTitleModule } from '...path-to-module';

export const myModule = angular
  .module('my.Module', [NgCustomTitleModule])
  .name;

On your AngularJS Component Controller you can add a value to be rendered and be editable ;)

export class myComponentController {

  myEditableTitle: string = 'Hi Guys!';

  constructor() {}

}

After that you need call the editable title component with one simple component declaration on HTML like:

  <ng-custom-title
    [title]="myEditableTitle"
    [placeholder]="'Section name'" 
    [error-text]="'Please enter name.'">
    (update)="myEditableTitle = $event">
  </ng-custom-title>