{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/6612","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/6612/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/6612/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/6612/events","html_url":"https://github.com/driftyco/ionic/issues/6612","id":156160487,"number":6612,"title":"ionic 2 beta 7 upgrade: issue with Promises","user":{"login":"khamaileon","id":1322166,"avatar_url":"https://avatars.githubusercontent.com/u/1322166?v=3","gravatar_id":"","url":"https://api.github.com/users/khamaileon","html_url":"https://github.com/khamaileon","followers_url":"https://api.github.com/users/khamaileon/followers","following_url":"https://api.github.com/users/khamaileon/following{/other_user}","gists_url":"https://api.github.com/users/khamaileon/gists{/gist_id}","starred_url":"https://api.github.com/users/khamaileon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khamaileon/subscriptions","organizations_url":"https://api.github.com/users/khamaileon/orgs","repos_url":"https://api.github.com/users/khamaileon/repos","events_url":"https://api.github.com/users/khamaileon/events{/privacy}","received_events_url":"https://api.github.com/users/khamaileon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/needs%20reply","name":"needs reply","color":"ededed"},{"url":"https://api.github.com/repos/driftyco/ionic/labels/v2","name":"v2","color":"313744"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-22T16:37:12Z","updated_at":"2016-05-24T16:08:57Z","closed_at":null,"body":"Since beta 7 and the use of zone.js, I can no longer use Promise.reject(). Any idea ?\r\n```javascript\r\nplatform.ready()\r\n  .then(log.info('platform ready'))\r\n  .then(() => this.getOrCreateUser(this))\r\n  .then(() => this.getOrCreateDevice(this))\r\n  .then(() => navigator.splashscreen.hide());\r\n\r\ngetOrCreateDevice() {\r\n  log.info('getOrCreateDevice');\r\n  if (typeof device === 'undefined') return Promise.reject();\r\n  ...\r\n}\r\n```\r\n```\r\nplatform ready\r\nAngular 2 is running in the development mode. Call enableProdMode() to enable the production mode.\r\nNative: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator\r\nEXCEPTION: Error: Uncaught (in promise): undefined\r\nEXCEPTION: Error: Uncaught (in promise): undefined\r\nSTACKTRACE:\r\nError: Uncaught (in promise): undefined\r\n    at resolvePromise (zone.js:538)\r\n    at resolvePromise (zone.js:523)\r\n    at zone.js:571\r\n    at ZoneDelegate.invokeTask (zone.js:356)\r\n    at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (ng_zone_impl.js:36)\r\n    at ZoneDelegate.invokeTask (zone.js:355)\r\n    at Zone.runTask (zone.js:256)\r\n    at drainMicroTaskQueue (zone.js:474)\r\n    at HTMLDocument.ZoneTask.invoke (zone.js:426)\r\nError: Uncaught (in promise): undefined(…)\r\n```\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/221321713","html_url":"https://github.com/driftyco/ionic/issues/6612#issuecomment-221321713","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/6612","id":221321713,"user":{"login":"khamaileon","id":1322166,"avatar_url":"https://avatars.githubusercontent.com/u/1322166?v=3","gravatar_id":"","url":"https://api.github.com/users/khamaileon","html_url":"https://github.com/khamaileon","followers_url":"https://api.github.com/users/khamaileon/followers","following_url":"https://api.github.com/users/khamaileon/following{/other_user}","gists_url":"https://api.github.com/users/khamaileon/gists{/gist_id}","starred_url":"https://api.github.com/users/khamaileon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khamaileon/subscriptions","organizations_url":"https://api.github.com/users/khamaileon/orgs","repos_url":"https://api.github.com/users/khamaileon/repos","events_url":"https://api.github.com/users/khamaileon/events{/privacy}","received_events_url":"https://api.github.com/users/khamaileon/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T16:08:57Z","updated_at":"2016-05-24T16:08:57Z","body":"I don't know plunker. It won't be easy for me :(\r\nBut you can reproduce easily by creating a new project\r\n```shell\r\nionic start fooBar tabs --v2\r\n```\r\nand replace app.js by this:\r\n```javascript\r\nimport {App, Platform} from 'ionic-angular';\r\nimport {StatusBar} from 'ionic-native';\r\nimport {TabsPage} from './pages/tabs/tabs';\r\n\r\n\r\n@App({\r\n  template: '<ion-nav [root]=\"rootPage\"></ion-nav>',\r\n  config: {} // http://ionicframework.com/docs/v2/api/config/Config/\r\n})\r\nexport class MyApp {\r\n  static get parameters() {\r\n    return [[Platform]];\r\n  }\r\n\r\n  constructor(platform) {\r\n    this.rootPage = TabsPage;\r\n\r\n    platform.ready().then(() => {\r\n      // Okay, so the platform is ready and our plugins are available.\r\n      // Here you can do any higher level native things you might need.\r\n      StatusBar.styleDefault();\r\n      this.foo();\r\n    });\r\n  }\r\n\r\n  foo() {\r\n    return Promise.reject();\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"khamaileon"}}