Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getConf() { // get from database
- return Restangular.all('conf').getList().then(function(conf) {
- return conf;
- })
- }
- function getConfObject() {
- return promiseConf.then(confArr => {
- return _(confArr).keyBy('myConf').value();
- });
- }
- this.config = null;
- init () {
- ...
- this.SomeService.getConfObject().then(conf => {
- this.config = do some thing with conf
- });
- ...
- }
- methodA () {
- // Can I be sure that in this place this.config is initialized from databse ?
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement