classpip-utils
v1.0.5
Published
Mobile Application for School Gamification
Downloads
3
Readme
Classpip Utils Library
Classpip is a Mobile application for School Gamification. The application is builded around a stack of services and websites to provide a full experience in order to gamificate any educational environment.
Description
This repository contains a utils library written in Typescript that defines angular 2 elements for using in the classpip applications (desktop and mobile). This library is organized in:
- components: A component is what you used to call a directive in AngularJS. It contains a template, styles, a list of injectables (directives, services) and a selector.
- directives: Directives allow you to attach behaviour to elements in the DOM. It is also what you used to call a directive in AngularJS, but without a proper view. You can therefore place as many directives as you want on one DOM-element. This is not possible with components.
- pipes: A pipe in Angular2 is the equivalent of filters in AngularJS. As in AngularJS, pipes can be stateless (pure functions, not reevaluated) or stateful (has dependencies that can modify the output).
- services: Service is a broad category encompassing any value, function, or feature that your application needs. Almost anything can be a service. A service is typically a class with a narrow, well-defined purpose. It should do something specific and do it well.
Installation
This library is published in npmjs as classpip-utils. You can find the main page here. For installing this library in your project you could run:
npm install classpip-utils --save
Once you have your library into the node_modules
directory, you should include the UtilsModule
into the NgModule of your application.
> app-module.ts
import { UtilsModule } from 'classpip-utils';
@NgModule({
declarations: [...],
imports: [
...
UtilsModule
...
],
bootstrap: [...],
entryComponents: [...],
providers: [...]
})
> some-component.ts
import { DatePipe } from 'classpip-utils';
Compile your code
The library is writter in Typescript, to generate the valid Javascript files for importing into another project you have to use the angular compiler and run the following command:
npm run ngc
Validation
The library includes some validation rules for linting the typescript code. To run this validation rules, you have to run:
npm run tslint
License
Classpip is released under the Apache2 License.