Skip to content

A tiny helper package that returns the query string data as a javascript object.

Notifications You must be signed in to change notification settings

anupkattel/angular-query-string-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Query String Helper

A tiny helper library for angular 2+ that returns the query string data as a javascript object.

Getting started

Prerequisites

If you want to install the library using the following method, you need to have npm installed and working on your system.

Installing

Install the package.

npm install --save angular-query-string-helper

Provide the library to the dependency injection system

import { QueryStringHelperService } from 'angular-query-string-helper'
...

@NgModule({
    ...
    providers: [QueryStringHelperService],
    ...
})

Usage

Inject the service via the constructor in the class you want to access query strings (for example in app.module.ts).

export class AppComponent {
    ...
    constructor(private _queryStringHelper: QueryStringHelperService, ...) {}
    ...    
}

Access the query string as a javascript object in your methods.

var queryString = this._queryStringHelper.QueryString;
var value = queryString.key;

License

This project is licensed under the MIT License.

About

A tiny helper package that returns the query string data as a javascript object.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published