I'd like to inject $ionicPlatform
abstraction into the service, but seemed I'm doing this wrong way. How should I use $ionicPlatform
with service?
(function () {
"use strict";
angular.module('service', []).service('BBNService', ["$ionicPlatform", function ($http, $localStorage, $ionicPlatform) {
This code making $ionicPlatform undefined.
Inject ionic dependency & Remove $http if you not using it as follows,
It's undefined because you wrong the order. (use
ionic.Platform
)Replace with this: