/angular_datatables

A simple angular app implementing dynamic datatables [UNSTABLE]

Primary LanguageTypeScript

Assign1

This project was generated with Angular CLI version 1.5.3.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app 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. Use the -prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

#setup data tables [https://l-lin.github.io/angular-datatables/#/getting-started]

npm install angular-datatables --save

install the dataTables script files

npm install datatables.net --save npm install datatables.net-dt --save

npm install @types/jquery --save-dev npm install @types/datatables.net --save-dev

install the responsive feature of data tables

npm install datatables.net-responsive --save npm install datatables.net-responsive-dt --save

install the buttons feature of dataTables

npm install datatables.net-buttons --save npm install datatables.net-buttons-dt --save

install the select feature of dataTables

npm install datatables.net-select --save npm install datatables.net-select-dt --save

After installing these, include the required js and css files in the scripts and styles property in apps[{}] in angular-cli.json file.

Next, import { DataTablesModule } from 'angular-datatables'; in app.module.ts and includeDataTablesModule in imports.

#setup MEANstack [https://scotch.io/tutorials/mean-app-with-angular-2-and-the-angular-cli]

install node

install angular cli => npm install -g @angular/cli

create new project => ng new mean-app => cd mean-app

run command => ng build

this is to create the "dist" folder, to which the node server will point to run the app

install express framework for node server => npm install --save express body-parser

create a server file at root directory => server.js with the following (basic) configuration

create a folder at root called "server". Create two sub folders within it "routes" and "models"

[we have included "routes" folder in our server.js file]

in "routes" create a file "api.js" with the following (basic) configuration

[this file will include the routes and their respective backend functionalities]

to run the app, run the "node server.js" command

install mongodb

install mongoose using npm => npm install mongoose --save

install bluebird using npm => npm install bluebird --save

establish (basic) connection to mongodb by writing the following in the server.js file

inside folder "server/models", create your collection file

if you have a collection (relational equivalent : table) called user, create a file User.js with the following