Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce application.lazyLoadingControllers config #687

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/application.ts
Expand Up @@ -15,6 +15,7 @@ export class Application implements ErrorHandler {
readonly actionDescriptorFilters: ActionDescriptorFilters
logger: Logger = console
debug = false
lazyLoadingControllers = false

static start(element?: Element, schema?: Schema): Application {
const application = new this(element, schema)
Expand Down
10 changes: 10 additions & 0 deletions src/tests/modules/core/application_tests.ts
Expand Up @@ -45,6 +45,16 @@ export default class ApplicationTests extends ApplicationTestCase {
this.assert.ok(this.controllers[0] instanceof BController)
}

"test Application#lazyLoadingControllers"() {
this.assert.equal(this.application.lazyLoadingControllers, false)

this.application.lazyLoadingControllers = true
this.assert.equal(this.application.lazyLoadingControllers, true)

this.application.lazyLoadingControllers = false
this.assert.equal(this.application.lazyLoadingControllers, false)
}

get controllers() {
return this.application.controllers as LogController[]
}
Expand Down