aurelia / template-lint

Sanity check of Aurelia-flavor template HTML
Apache License 2.0
56 stars 17 forks source link

Support Global Resources #130

Open MeirionHughes opened 7 years ago

MeirionHughes commented 7 years ago

requires analyzing the configure(config) methods in user code - not trivial.

atsu85 commented 7 years ago

I supposed BindingBehaviors can globalized the same way

mttmccb commented 7 years ago

Would this also cover something like this? I'm using ViewEngineHooks to give me access to features in the view which are just a series of feature flags.

import {
  View,
  ViewEngineHooks
} from 'aurelia-framework';
import features from '../config/features';

export interface ICustomView extends View {
  overrideContext: {
    features: any
  };
}

export class ConstantsViewEngineHooks implements ViewEngineHooks {
  public beforeBind(view: ICustomView) {
    view.overrideContext.features = features;
  }
}