carbon-tutorial-angular icon indicating copy to clipboard operation
carbon-tutorial-angular copied to clipboard

Problems with Step 1: Add UI Shell

Open Jasbee-IBM opened this issue 4 years ago • 7 comments

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';

Jasbee-IBM avatar May 20 '21 14:05 Jasbee-IBM

Having the same issue :/

reev-create avatar Jun 02 '21 05:06 reev-create

it seems the tutorial instructions got outdated.

pyrobit avatar Jul 01 '21 22:07 pyrobit

I found an alternative using a bootstrap and CSS of the actual library

reev-create avatar Jul 03 '21 10:07 reev-create

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>

weirdyang avatar Jul 09 '21 07:07 weirdyang

import { UIShellModule } from 'carbon-components-angular/ui-shell/ui-shell.module';

should the above line be import { UIShellModule } from 'carbon-components-angular'; ?

weirdyang avatar Jul 09 '21 08:07 weirdyang

It seems @carbon/icons-angular is not yet Ivy compatible as well.

lordememphis avatar Nov 20 '22 07:11 lordememphis