forked from gridstack/gridstack.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* show creating grid items content components on the fly by type (rather than hard code in template)
- Loading branch information
Showing
5 changed files
with
95 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* gridstack.component.ts 7.3.0-dev | ||
* Copyright (c) 2022 Alain Dumesny - see GridStack root license | ||
*/ | ||
|
||
// dummy testing component that will be grid items content | ||
|
||
import { Component, Type } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-a', | ||
template: 'Comp A', | ||
}) | ||
export class AComponent { | ||
} | ||
|
||
@Component({ | ||
selector: 'app-b', | ||
template: 'Comp B', | ||
}) | ||
export class BComponent { | ||
} | ||
|
||
@Component({ | ||
selector: 'app-c', | ||
template: 'Comp C', | ||
}) | ||
export class CComponent { | ||
} | ||
|
||
/** | ||
* stores the selector -> Type mapping, so we can create items dynamically from a string. | ||
* Unfortunately Ng doesn't provide public access to that mapping. | ||
*/ | ||
export const selectorToComponent: {[key: string]: Type<Object>} = { | ||
'app-a': AComponent, | ||
'app-b': BComponent, | ||
'app-c': CComponent, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters