Skip to content

ball6847/ng2-parse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular2 Parse Service

Still in development. Currently only make Parse injectable to component.

Installation

You have to install from github for now.

npm install --save parse https://github.com/ball6847/ng2-parse.git

# @types/parse (my fork)
npm install --save-dev https://github.com/ball6847/typings-parse.git

Adding Parse as global dependency.

ng2-parse does not directly import parse from node_modules, instead it uses Parse from global scope.

To make Parse available globally, please add "./node_modules/parse/dist/parse.js" to apps.scripts section in angular-cli.json. (webpack implementation will be available shortly)

{
  ...
  "apps": [
    {
      ...
      "scripts": [
        "./node_modules/parse/dist/parse.js"
      ],
      ...
    }
  ],
  ...
}

Make sure the reference to parse/dist/parse.js is correct.

Adding ParseService to your Application

In order to use ParseService in your application. You just need to provide it in your AppModule.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { ParseService } from 'ng2-parse'; // <-- import ParseService

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule
  ],
  providers: [ParseService], // <-- Provide ParseService
  bootstrap: [AppComponent]
})
export class AppModule { }

You can now start using ng2-parse service in your angular2 application.

Examples

Using ParseService in your app's component. All you need to do is injecting it via DI.

import { Component } from '@angular/core';
import { ParseService } from 'ng2-parse';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
})
export class AppComponent {
  // inject ParseService
  constructor(private Parse: ParseService) {
  }
}

TODO

  • Add webpack example.
  • Add ParseConfig module.
  • Add tests.

Releases

No releases published

Packages

No packages published