Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

New object instance with imported argument

$
0
0

@avi112211 wrote:

Hi all,

I’m new to Inonic.
My question is, I have this class that I’ve created:

import { HttpServiceProvider } from './../providers/http-service/http-service';

export class HttpWrapper{

    private _url: string;
    private _port: number;
    private _api: string;
    private _headers: Map<string, string>;

    constructor(private httpServie: HttpServiceProvider, url: string, port: number, api: string){
        this.url = url;
        this.port = port;
        this.api = api;
    }

When I want to create a new instance of this class I need to provide ‘HttpServiceProvider’ to the constructor. What is the right way to initiate new object of this kind? (without providing the ‘HttpServiceProvider’).

Thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>