1 | import angular from 'angular';
|
2 |
|
3 | import {storiesOf} from '@storybook/html';
|
4 |
|
5 | import angularDecorator, {APP_NAME} from '../../.storybook/angular-decorator';
|
6 | import CompilerNG from '../compiler-ng/compiler-ng';
|
7 |
|
8 | storiesOf('Legacy Angular|Compiler Ng', module).
|
9 | addParameters({hermione: {skip: true}}).
|
10 | addDecorator(angularDecorator()).
|
11 | add('basic', () => {
|
12 | angular.module(APP_NAME, [CompilerNG]).
|
13 | run(function controller($rootScope, rgCompiler) {
|
14 | const $scope = $rootScope.$new();
|
15 | $scope.testValue = 'Hello from compiled node';
|
16 |
|
17 | rgCompiler({template: '<div>{{testValue}}</div>'}).
|
18 | then(data => {
|
19 | data.link($scope);
|
20 | setTimeout(() => {
|
21 | document.getElementById('for-compiled').appendChild(data.element[0]);
|
22 | });
|
23 | });
|
24 | });
|
25 |
|
26 | return '<div id="for-compiled"></div>';
|
27 | });
|