Repository navigation
docs(badge): register icons in the JavaScript tab bar playground - #4848
Merged
Merged
Conversation
The JavaScript "Badges in Tab Buttons" example used ion-icon names without registering them, so StackBlitz fetched /svg/*.svg and the icons did not load. Split it into index.html and index.ts and register the icons with addIcons, matching the other JavaScript examples. Also remove unused javascript.md files from the reorder custom-icon and fab css-shadow-parts examples, which already load javascript/index_html.md and javascript/index_ts.md.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the current behavior?
When the JavaScript version of the Badges in Tab Buttons example (on the Tab Bar and Badge pages) is opened in StackBlitz, the icons don't load. The example uses
<ion-icon name="...">without registering the icons, so Ionicons tries to fetch/svg/heart.svgand the other icons. In the StackBlitz project, those requests returnindex.htmlinstead of the SVG.The other JavaScript examples that use icons don't have this problem because they include an
index.tsthat registers their icons withaddIcons.What is the new behavior?
badge/inside-tab-barJavaScript example is now split intojavascript/index_html.mdandjavascript/index_ts.md, matchingbutton/icons. Theindex.tsregisterscalendar,heartandmusicalNotewithaddIcons.javascript.mdfiles from the v8 and v9reorder/custom-iconandfab/theming/css-shadow-partsexamples. Those examples already loadjavascript/index_html.mdandjavascript/index_ts.md.Testing
Loaded the new files into the v9 JavaScript StackBlitz template locally and opened it in headless Chrome. All three icons rendered, and no requests were made to
/svg/.