0.0.7 • Published 6 years ago

custom-angular-decorators v0.0.7

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

custom-angular-decorators

Decorators for Angular, which will make life easier for you

install

npm install --save custom-angular-decorators

And add the include line "node_modules/custom-angular-decorators/**/index.ts" in tsconfig.json file

decorators

RoadMap

DecoratorsStatus
AutoUnsubscribeTesting
LifeCycleLogTesting
NotNullTesting
DisableFieldNot started
PhoneNot started

Class decorator

AutoUnsubscribe(production: boolean)

Decorator for auto unsubscribed your Subscription property and array with Subscription elements.

@Component({
     selector: 'app-root',
     templateUrl: './app.component.html',
     styleUrls: ['./app.component.scss'],
})
@AutoUnsubscribe(environment.production)
export class AppComponent { }

Property decorator

LifeCycleLog(production: boolean)

Logger for your component property on LifeCycle Hooks.

export class AppComponent implements OnInit {
    @LifeCycleLog(environment.production)
    public property;
    
    ngOnInit() {
        this.property = 10;
    }
}

NotNull()

Check null property in model and generate exception.

class Model {
  @NotNull
  public field;

  constructor(field) {
    this.field = field;
  }
}
0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago