Routes and Controllers
Templates associated with Ember routes and/or controllers will be typechecked against those backing classes without needing to import from Glint-specific paths.
If a controller class exists, then @model
in the corresponding template will have the type of the controller's declared model
property, and {{this}}
will be the type of the controller itself.
If no controller exists but a route does, then {{@model}}
will be the return type of the route's model()
hook (unwrapping any promise if necessary), and {{this}}
will be the type of an empty controller with a model
property of the same type as @model
.
For error
substate routes, the type of {{@model}}
will not be automatically inferred. You will need to create a backing class for the route if you consume its model in the corresponding template:
Last updated