-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(angular/load-icon): add example
- Loading branch information
1 parent
9b6e9c7
commit 5a71e4b
Showing
9 changed files
with
182 additions
and
54 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
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
22 changes: 22 additions & 0 deletions
22
packages/angular-test-app/src/preview-examples/load-icon.css
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,22 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
/* | ||
* Styles get overwritten by html-test-app css files each build or dev task. | ||
* If you want to modify the example styles do this only inside the html-test-app | ||
*/ | ||
|
||
body { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
div, | ||
ix-icon { | ||
margin: 0.25rem; | ||
} |
2 changes: 2 additions & 0 deletions
2
packages/angular-test-app/src/preview-examples/load-icon.html
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,2 @@ | ||
<ix-icon name="info"></ix-icon> | ||
<ix-icon *ngIf="showIcon" name="star"></ix-icon> |
34 changes: 34 additions & 0 deletions
34
packages/angular-test-app/src/preview-examples/load-icon.ts
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,34 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import { Component, Input } from '@angular/core'; | ||
import { loadIcons } from '@siemens/ix-icons'; | ||
import { defineCustomElements as defineCustomIconElements } from '@siemens/ix-icons/loader'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
templateUrl: './load-icon.html', | ||
styleUrls: ['./load-icon.css'], | ||
}) | ||
export default class LoadIcon { | ||
@Input() showIcon = false; | ||
|
||
constructor() { | ||
(async () => { | ||
defineCustomIconElements(); | ||
})(); | ||
|
||
const icons = ['info', 'star', 'star-filled']; | ||
loadIcons(icons); | ||
|
||
setTimeout(() => { | ||
this.showIcon = true; | ||
}, 1000); | ||
} | ||
} |
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
Oops, something went wrong.