0.6.0 • Published 3 years ago

ngx-cloud-scripture v0.6.0

Weekly downloads
36
License
-
Repository
github
Last release
3 years ago

NgxCloudScripture

Install

npm install ngx-cloud-scripture --save

Get API Key

Navigate to https://cloudscripture.com/developer and click Get Started to create an account.

Once you create an account, you will be redirected back to the developer page.

The Get Started button will now be replaced by your API Key.

For this example, we will use the fake key ABCDEFG-HIJKLMN-OPQRSTU-VWXYZZZ

Import

import { NgModule } from '@angular/core';
import { NgxCloudScriptureModule } from 'ngx-cloud-scripture';

@NgModule({
    imports: [
        NgxCloudScriptureModule.forRoot({apiKey: 'ABCDEFG-HIJKLMN-OPQRSTU-VWXYZZZ'})
    ],
})
export class AppModule { }

Usage

import { Component } from '@angular/core';
import { NgxCloudScriptureService, DailyVerse, DailyReading } from 'ngx-cloud-scripture';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.scss']
})
export class AppComponent {

    constructor(private cloudScriptureService: NgxCloudScriptureService) {

    }

    public getDailyVerse() {
        // The version defaults to 'KJV' if none is given.
        // Currently only 'KJV' and 'NKJV' are supported.
        this.cloudScriptureService.getDailyVerse('NKJV').subscribe((dailyVerse: DailyVerse) => {
            console.log(dailyVerse);
        });
    }

     public getDailyReading() {
        // The version defaults to 'KJV' if none is given.
        // Currently only 'KJV' and 'NKJV' are supported.
        this.cloudScriptureService.getDailyReading('NKJV').subscribe((dailyReadings: DailyReading[]) => {
            console.log(dailyReadings);
        });
    }

}

Classes

DailyVerse
PropertyDescriptionData Type
bookBook of the Bible that the verse resides in.string
chapterChapter of the book that the verse resides in.number
copyrightDetails of the Bible version's copyright (if applicable).string
formattedFormatted verse for citing. Ex: "John 3:16"string
textThe text content of the verse.string
verseThe number reference of the verse.number
versionThe requested Bible version abbreviation.string
DailyReading
PropertyDescriptionData Type
copyrightDetails of the Bible version's copyright (if applicable).string
passageTitle of the reading passage. Ex: "1 Samuel 1-3"string
versesCollection of all verses in the reading passageVerse []
versionThe requested Bible version abbreviation.string
Verse
PropertyDescriptionData Type
bookBook of the Bible that the verse resides in.string
chapterChapter of the book that the verse resides in.number
formattedFormatted verse for citing. Ex: "John 3:16"string
textThe text content of the verse.string
verseThe number reference of the verse.number

Support

Have questions? Contact support@swanscript.net

Submit bugs to https://github.com/ShinyGeodavid/ngx-cloud-scripture/issues.