This project is built using Angular 4. It serves as an example of recursion, in angular components. It features a nested list interface which is recursively (read: dynamically) built based on the recursive list data that has been passed to the list component. Sample data model for a list item is as follows
class ListDataItem {
id: string;
caption: string;
isSelected: boolean;
subItems: ListDataItem[];
}
The listDataItem
component, denoting a row of the list, is re-used (recursively) to generate the nested list with its children items, GrandChildren Items etc as required. (depending on the depth of the recursive list data). <app-list-item>
is the component which has been used recursively. Pay attention to how the data has been passed to the nested component in the HTML using Angular's component arguments. Hopefully this serves as a sample for understanding nesting of components using Angular.
- Live Search: allows searching of the list-data. (currently only for the top-most level of nesting)
- Selected item count: The counter at the bottom of the page keeps a count of the number of list-items that have been checked. (currently only for the top-most level of nesting)
- The selected items can then be exported as a filtered list.
Since this is an Angular project, you need to have node and AngularCli (or likewise to allow angular commands)
Node is really easy to install & now include NPM. You should be able to run the following command after the installation procedure below.
$ node --version
v0.10.24
$ npm --version
1.3.21
Example,
Just go on official Node.js website & grab the installer.
Also, be sure to have git
available in your PATH, npm
might need it.
Required to run this project (allows use of ng
). You should be able to run the following command after the installation procedure
below.
$ ng -v
After installing npm, install AngularCLI
npm install -g @angular/cli
After cloning the repository, use the build.bat file to initialize the project. (Once you've successfully installed node.js and angularCli).
- Runs
npm install
inrepo\client
folder. - Downloads all npm modules mentioned in package.json.
- finally serves the project on localhost using
ng serve
Alternatively,
- Clone the repository.
cd
into the client folder.- Use
ng serve
to deploy project. (Angular with VS code default islocalhost:4200
)
- Fork it!
- Create your feature branch: git checkout -b my-new-feature (Your feature deserves a description!)
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request :D