Skip to content

Instantly share code, notes, and snippets.

@perlun
Created March 26, 2018 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perlun/367b75cf74f3617886377764fc469a8c to your computer and use it in GitHub Desktop.
Save perlun/367b75cf74f3617886377764fc469a8c to your computer and use it in GitHub Desktop.
ember-cli-typescript with Route mixins
// Almost works, but it still complains about a few missing properties with this approach
export default class ProtectedRoute extends Ember.Route.extend(AuthenticatedRouteMixin) {
public actions: null;
public activate: null;
public afterModel: null;
public beforeModel: null;
public controller: null;
public controllerFor: null;
public controllerName: null;
public deactivate: null;
public didTransition: null;
public disconnectOutlet: null;
public error: null;
public get: null;
public getProperties: null;
public has: null;
public loading: null;
public model: null;
public modelFor: null;
public notifyPropertyChange: null;
public off: null;
public on: null;
public one: null;
public paramsFor: null;
public queryParams: null;
public redirect: null;
public refresh: null;
public render: null;
public renderTemplate: null;
public replaceWith: null;
public resetController: null;
public routeName: null;
public send: null;
public serialize: null;
public set: null;
public setProperties: null;
public setupController: null;
public store: null;
public templateName: null;
public transitionTo: null;
public trigger: null;
public willTransition: null;
}
// Works, but no mixin. :/
export default class ProtectedRoute extends Ember.Route.extend() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment