node package manager
Don’t reinvent the wheel. Reuse code within your team. Create a free org »

@salaxy/ng

Angular 2 libraries for Salaxy platform

Provides infrastructure for creating an Angular 2 based web site using the Salaxy open API.

  • @salaxy/core
    • TypeScript object model generated from the API / Swagger files
    • Service proxies that make it easier for calling the API
    • Authentication infrastructure
  • @salaxy/ng/services
    • SessionService for authentication and session handling
    • Repository pattern (with session context) for easier CRUD functionality
  • Components
    • Authentication Components: Login button and Token receiver
    • Helpers: Avatar and other UI
    • CRUD list and editing for Workers
    • Basic anonymous calculator, calculations list and edit view
    • We are adding calculator and other such helper components as we go further.

Usage

  • Run npm install --save @salaxy/ng@latest
  • This will also include the @salaxy/core libraries

Getting started: New Angular CLI site with NPM

If you already have Node installed:

  1. Check node version: node --version - must be at least 6.9
  2. Check npm version: npm –version - must be at least 3.10.8
  3. Install Angular-cli: npm install -g @angular/cli
    • If you already have it installed, check version: ng ––version - at least 1.0.0-beta.32.3
  4. Create a new Angular-cli project:
    ng new salaxy-training-ng --style=scss
    cd salaxy-training-ng
  5. Install Salaxy packages:
    npm install --save @salaxy/ng@latest
    This includes @salaxy/core@latest and @angular/material
  6. Copy the following files from the folder /node_modules/@salaxy/ng/demo
    • styles.scss => /src/styles.scss (replace or edit)
    • app.module.ts => /src/app/app.module.ts (replace or edit)
    • app.component.html => /src/app/app.component.html (replace or edit)
    • welcome => /src/app/welcome (new folder with 2 files)
  7. Run ng serve
  8. Go to http://localhost:4200

To install the required Node and NPM

  1. Install the latest version of Node.js from https://nodejs.org/. Use the default installation options (LTS version).
  2. Node comes with npm installed so you should have a version of npm.
    Update it by running npm install npm@latest -g
  3. Grunt is currently used only for npm packaging, so typically, you would not need it. npm install -g grunt-cli

More information

For more information and documentation about Salaxy platform, please go to https://developers.salaxy.com