carbon-tutorial-angular
carbon-tutorial-angular copied to clipboard
Problems with Step 1: Add UI Shell
Is the tutorial still up to date?
https://www.carbondesignsystem.com/developing/angular-tutorial/step-1#add-ui-shell
At some point during this step, we need to import the icons from our @carbon/icons package like:
import Notification16 from '@carbon/icons/es/notification/16'; import UserAvatar16 from '@carbon/icons/es/user--avatar/16'; import AppSwitcher16 from '@carbon/icons/es/app-switcher/16';
But when I look into the files at GitHub, it looks like newer carbon components are used, for example:
import { Notification20Module } from '@carbon/icons-angular/lib/notification/20'; import { UserAvatar20Module } from '@carbon/icons-angular/lib/user--avatar/20'; import { AppSwitcher20Module } from '@carbon/icons-angular/lib/app-switcher/20';
Having the same issue :/
it seems the tutorial instructions got outdated.
I found an alternative using a bootstrap and CSS of the actual library
seems like the new way is to first import the following modules in app.module.ts
import {
NotificationModule,
UserAvatarModule,
AppSwitcherModule
} from '@carbon/icons-angular';
and use it like so:
<ibm-header name="Carbon Tutorial Angular">
<ibm-header-navigation>
<ibm-header-item routerLink="/repos">Repositories</ibm-header-item>
</ibm-header-navigation>
<ibm-header-global>
<ibm-header-action title="action">
<svg ibmIconNotification
size="20"></svg>
</ibm-header-action>
<ibm-header-action title="action">
<svg ibmIconUserAvatar
size="20"></svg>
</ibm-header-action>
<ibm-header-action title="action">
<svg ibmIconAppSwitcher
size="20"></svg>
</ibm-header-action>
</ibm-header-global>
</ibm-header>
import { UIShellModule } from 'carbon-components-angular/ui-shell/ui-shell.module';
should the above line be import { UIShellModule } from 'carbon-components-angular'; ?
It seems @carbon/icons-angular is not yet Ivy compatible as well.