Guest User

Untitled

a guest
Apr 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.17 KB | None | 0 0
  1. /* SystemJS module definition */
  2. declare var module: NodeModule;
  3. declare module 'dmn-js';
  4. interface NodeModule {
  5. id: string;
  6. }
  7.  
  8. import { Component, OnInit } from '@angular/core';
  9. import {HttpClient} from '@angular/common/http';
  10. import * as DmnJS from 'dmn-js';
  11.  
  12.  
  13. @Component({
  14. selector: 'app-root',
  15. templateUrl: './app.component.html',
  16. styleUrls: ['./app.component.css']
  17. })
  18. export class AppComponent implements OnInit {
  19. title = 'DMN';
  20.  
  21. constructor(private http: HttpClient){
  22. }
  23.  
  24. ngOnInit(): void {
  25. var viewer = new DmnJS ({ container: 'body' });
  26. var dmnXML; //DMN 1.1 xml
  27. viewer.importXML(dmnXML, this.handleError);
  28. }
  29.  
  30. handleError(err: any) {
  31. if (err) {
  32. console.warn('Ups, error: ', err);
  33. }else {
  34. console.log('rendered');
  35. }
  36. }
  37.  
  38. load(): void {
  39. const url = '/assets/dish-decision.dmn';
  40. this.http.get(url, {
  41. headers: {observe: 'response'}, responseType: 'text'
  42. }).subscribe(
  43. (x: any) => {
  44. console.log('Fetched XML, now importing: ', x);
  45. //this.modeler.importXML(x, this.handleError);
  46. },
  47. this.handleError
  48. );
  49. }
  50.  
  51. save(): void {
  52. //this.modeler.saveXML((err: any, xml: any) => console.log('Result of saving XML: ', err, xml));
  53. }
  54.  
  55. }
  56.  
  57. ERROR in ./node_modules/dmn-js-drd/lib/Viewer.js
  58. Module parse failed: Unexpected token (175:4)
  59. You may need an appropriate loader to handle this file type.
  60. | additionalModules,
  61. | canvas,
  62. | ...additionalOptions
  63. | } = options;
  64. |
  65. ERROR in ./node_modules/dmn-js-shared/lib/base/Manager.js
  66. Module parse failed: Unexpected token (292:16)
  67. You may need an appropriate loader to handle this file type.
  68. | }
  69. |
  70. | _viewsChanged = () => {
  71. | this._emit('views.changed', {
  72. | views: this._views,
  73. ERROR in ./node_modules/dmn-js-decision-table/lib/Viewer.js
  74. Module parse failed: Unexpected token (75:6)
  75. You may need an appropriate loader to handle this file type.
  76. | modules,
  77. | additionalModules,
  78. | ...config
  79. | } = options;
  80. |
  81. ERROR in ./node_modules/dmn-js-literal-expression/lib/Viewer.js
  82. Module parse failed: Unexpected token (77:6)
  83. You may need an appropriate loader to handle this file type.
  84. | modules,
  85. | additionalModules,
  86. | ...config
  87. | } = options;
  88. |
  89.  
  90. webpack: Failed to compile.
Add Comment
Please, Sign In to add comment