# Singleton providers?

**URL:** <https://forum.ionicframework.com/t/singleton-providers/58038>\
**Category:** ionic-v3\
**Created:** [July 20, 2016, 8:01am UTC](https://forum.ionicframework.com/t/singleton-providers/58038 "2016-07-20T08:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nylex](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@nylex](https://forum.ionicframework.com/u/nylex)\
**Post date:** [July 20, 2016, 8:01am UTC](https://forum.ionicframework.com/t/singleton-providers/58038/1 "2016-07-20T08:01:34Z")

</div>

I have made a provider which uses `@injectable`, its suppose to be singleton in all over the application but somehow when i console.log the data.items, they always come up empty, means it re instantiated the provider every time. Or am i missing something to make it singleton?

---

<div class="post-metadata">

**Author:** ![nylex](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@nylex](https://forum.ionicframework.com/u/nylex)\
**Post date:** [July 20, 2016, 4:01pm UTC](https://forum.ionicframework.com/t/singleton-providers/58038/2 "2016-07-20T16:01:29Z")

</div>

Anyone can please guide me

---

<div class="post-metadata">

**Author:** ![guillodacosta](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@guillodacosta](https://forum.ionicframework.com/u/guillodacosta)\
**Post date:** [July 21, 2016, 4:35pm UTC](https://forum.ionicframework.com/t/singleton-providers/58038/3 "2016-07-21T16:35:36Z")

</div>

Hello,

some things you can consider me or worked to perfection

first component or principal, in this instantiate it, see below ioniBootstrap

import {SingletonX} from ‘./services/aafaf’;  
@Component({  
templateUrl: ‘build/xxxx.html’  
})  
export class ClassA {  
get static parameters () {  
return [  
[SingletonX]];}  
constructor (\_singletonX) {  
this.\_singletonX = \_singletonX;  
}

method () {  
this.\_singletonX.setXXX (dddd)  
}  
}  
ionicBootstrap (ClassA [SingletonX])

- The singleton

@Injectable ()  
Const export class {  
get static parameters () {  
return [[Importer]];  
}  
constructor (\_importer) {  
this.\_importer = \_importer;  
this.\_k = new Object ();  
}  
setXXX (ddddd) {  
this.\_k  
}  
getXXX (ddddd) {  
this.\_k return [ddddd]  
}  
…

- Other component, see that is not in the provider

import {SingletonX} from ‘./services/aafaf’;  
@Component ({  
providers: [otherProviders],  
templateUrl: ‘build / pages / xxxxx.html’  
})  
export OtherComponent class {  
get static parameters () {  
return [  
[Const]];  
}  
constructor (\_const) {  
this.\_const = \_const;  
}

xMethod () {  
xxx = this.\_const.getXXX let (xxxx);  
}  
…

Finally I do not speak English but look especially in not re-inject as provider, and must take into account the bootstrap.

If something comes back and asks
