UNPKG

871 BJavaScriptView Raw
1import angular from 'angular';
2
3import {storiesOf} from '@storybook/html';
4
5import angularDecorator, {APP_NAME} from '../../.storybook/angular-decorator';
6import {CheckmarkIcon, WarningIcon} from '../icon';
7
8import IconNG from './icon-ng';
9
10storiesOf('Legacy Angular|Icon Ng', module).
11 addParameters({
12 notes: 'Provides an Angular wrapper for Icon.'
13 }).
14 addDecorator(angularDecorator()).
15 add('basic', () => {
16 angular.module(APP_NAME, [IconNG]).
17 controller('testCtrl', function ctrl() {
18 this.icon = CheckmarkIcon;
19 this.error = WarningIcon;
20 });
21
22 return `
23 <div ng-controller="testCtrl as ctrl">
24 <rg-icon glyph="{{ctrl.icon}}"></rg-icon>
25 <rg-icon glyph="{{ctrl.icon}}" color="MAGENTA"></rg-icon>
26 <rg-icon glyph="{{ctrl.icon}}" color="{{'BLUE'}}" loading="true"></rg-icon>
27 </div>
28 `;
29 });