mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] app: add name as a config option
Useful for tooling purpose closes #1342
This commit is contained in:
@@ -14,6 +14,7 @@ export interface Env {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface AppConfig<P, E> extends TemplateSetConfig {
|
export interface AppConfig<P, E> extends TemplateSetConfig {
|
||||||
|
name?: string;
|
||||||
props?: P;
|
props?: P;
|
||||||
env?: E;
|
env?: E;
|
||||||
test?: boolean;
|
test?: boolean;
|
||||||
@@ -54,6 +55,7 @@ export class App<
|
|||||||
> extends TemplateSet {
|
> extends TemplateSet {
|
||||||
static validateTarget = validateTarget;
|
static validateTarget = validateTarget;
|
||||||
|
|
||||||
|
name: string;
|
||||||
Root: ComponentConstructor<P, E>;
|
Root: ComponentConstructor<P, E>;
|
||||||
props: P;
|
props: P;
|
||||||
env: E;
|
env: E;
|
||||||
@@ -63,6 +65,7 @@ export class App<
|
|||||||
|
|
||||||
constructor(Root: ComponentConstructor<P, E>, config: AppConfig<P, E> = {}) {
|
constructor(Root: ComponentConstructor<P, E>, config: AppConfig<P, E> = {}) {
|
||||||
super(config);
|
super(config);
|
||||||
|
this.name = config.name || "";
|
||||||
this.Root = Root;
|
this.Root = Root;
|
||||||
window.__OWL_DEVTOOLS__.apps.add(this);
|
window.__OWL_DEVTOOLS__.apps.add(this);
|
||||||
if (config.test) {
|
if (config.test) {
|
||||||
|
|||||||
Reference in New Issue
Block a user