Angular
This document shows you haw you can create an FlowChart JS Angular project.
-
Create a new project:
ng new flowchart
-
Go to the project root folder:
cd flowchart
-
Install FlowChart JS
- Download and extract the package.
-
Create a folder balkanapp in \src and copy the extracted files there.
-
Add this at the end of the flowchart.d.ts file:
export default FlowChart
-
Add the flowchart.js file in the scripts arrays in your angular.json file:
"src/balkanapp/flowchart.js"
-
In your app.component.ts add this reference:
import FlowChart from "../balkanapp/flowchart";
-
In the app.component.html file add or replase the content with this:
<style> #chart { width: 100%; height: 700px; } </style> <div id="chart"></div>
-
In the export class of app.component.ts add this code:
constructor() { } ngOnInit() { if (document.getElementById('chart')) { var chart = new FlowChart("#chart", { }); chart.load( { nodes: [ { id: 1, templateId: 'startEnd', x: 400, y: 150, text: "Start"}, ] } ); } }
-
Start the project:
ng serve