-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cc6a8a
commit b8d97b3
Showing
23 changed files
with
2,690 additions
and
2,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,50 @@ | ||
# AnuglarFlow | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 16.1.4. | ||
|
||
## Development server | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. | ||
|
||
## Code scaffolding | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
|
||
## Build | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
## Running unit tests | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
## Running end-to-end tests | ||
|
||
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. | ||
|
||
## Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. | ||
# Angular Flow | ||
|
||
Angular Flow is a component that allows you to create a flow diagram using Angular. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @ngu/flow | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
import { Component } from "@angular/core"; | ||
import { FlowComponent, FlowChildComponent } from "@ngu/flow"; | ||
|
||
@Component({ | ||
selector: "app-root", | ||
standalone: true, | ||
imports: [FlowComponent, FlowChildComponent], | ||
template: ` | ||
<ngu-flow class="flow"> | ||
@for (item of lists; track item.id; let i = $index) { | ||
<div [flowChild]="item" class="child">{{ i }}</div> | ||
} | ||
</ngu-flow> | ||
`, | ||
styles: ` | ||
.flow { | ||
min-height: 90vh; | ||
background: #eee; | ||
} | ||
.child { | ||
border: 1px solid #ccc; | ||
width: 100px; | ||
height: 50px; | ||
background: white; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
`, | ||
}) | ||
export class AppComponent { | ||
lists = [ | ||
{ id: "1", x: 0, y: 0, deps: [] }, | ||
{ id: "2", x: 0, y: 0, deps: ["1"] }, | ||
]; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.