Skip to content

Aurelia Snippets

Prosper Otemuyiwa edited this page Jul 9, 2016 · 1 revision

Aurelia: canActivate() { ... } - _cat

canActivate() {
  
}

Aurelia: activate() { ... } - _act

activate() {
  
}

Aurelia: deactivate() { ... } - _dct

deactivate() {
  
}

Aurelia: canDeactivate(n) { ... } - _cda

canDeactivate() {
  
}

Aurelia: created(ov, mv) { ... } - _cre

created(owningView: View, myView: View) {
  
}

Aurelia: bind(bc, oc) { ... } - _bin

bind(bindingContext: Object, overrideContext: Object) {
  
}

Aurelia: attached() { ... } - _att

attached() {

}

Aurelia: detached() { ... } - _det

detached() {

}

Aurelia: unbind() { ... } - _unb

unbind() {

}

Aurelia: use plugin - _aup

aurelia.use.plugin('');

Aurelia decorators: @syncChildren(pp, cH, sl) - _sc

@syncChildren(property, changeHandler, selector)

Aurelia decorators: @skipContentProcessing - _sp

@skipContentProcessing

Aurelia decorators: @useView(path) - _uv

@useView('')

Aurelia decorators: @noView - _nv

@noView

Aurelia decorators: @inject - _ij

@inject('')

Aurelia decorators: @customAttribute - _ca

@customAttribute('')

Aurelia decorators: @bindable - _bd

@bindable('')

Aurelia: Logging - _log

import {LogManager} from 'aurelia-framework';
      import {ConsoleAppender} from 'aurelia-logging-console';

      LogManager.addAppender(new ConsoleAppender());
      LogManager.setLevel(LogManager.logLevel.debug);

      export function configure(aurelia) {
        aurelia.use
          .standardConfiguration;

        aurelia.start().then(() => aurelia.setRoot());
      }

Aurelia: configure - _cnf

export function configure(aurelia) {
        aurelia.use
          .standardConfiguration()
          .developmentLogging();

 
      };

Aurelia: configure globalResources - _cfg

export function configure(aurelia) {
        aurelia.use
          .standardConfiguration()
          .developmentLogging()
          .globalResources('${1}');

        aurelia.start().then(() => aurelia.setRoot());

      };

Aurelia: configureRouter() { ... } - _cfr

configureRouter(config, router) {
       config.title = '';
       config.map([
        { route: ['',''],  name: '', moduleId: '', nav: true, title:'' },
       ]);

       this.router = router;
     }

Aurelia: class Skeleton - _class

  import { '' }  from 'aurelia-framework';

      export class {2} {
         constructor(){

         }
      }