Subversion Repositories SmartDukaan

Rev

Rev 13542 | Rev 13557 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13542 Rev 13551
Line 5... Line 5...
5
// the 2nd parameter is an array of 'requires'
5
// the 2nd parameter is an array of 'requires'
6
// 'starter.services' is found in services.js
6
// 'starter.services' is found in services.js
7
// 'starter.controllers' is found in controllers.js
7
// 'starter.controllers' is found in controllers.js
8
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'starter.filters', 'LocalStorageModule','ngResource'])
8
angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'starter.filters', 'LocalStorageModule','ngResource'])
9
 
9
 
10
.run(function($ionicPlatform) {
10
.run(function($ionicPlatform,$rootScope) {
-
 
11
  $rootScope.likeProduct = function(id){
-
 
12
    alert('like '+id);
-
 
13
    console.log(id);
-
 
14
  },
-
 
15
  $rootScope.unlikeProduct = function(id){
-
 
16
    alert('unlike '+id);
-
 
17
    console.log(id);
-
 
18
  }
-
 
19
  $rootScope.viewproduct = function(id){
-
 
20
    alert('view product '+id);
-
 
21
  } 
-
 
22
  $rootScope.chunk = function(arr, size) {
-
 
23
    var newArr = [];
-
 
24
    for (var i=0; i<arr.length; i+=size) {
-
 
25
      newArr.push(arr.slice(i, i+size));
-
 
26
    }
-
 
27
    return newArr;
-
 
28
  } 
11
  $ionicPlatform.ready(function() {
29
  $ionicPlatform.ready(function() {
12
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
30
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
13
    // for form inputs)
31
    // for form inputs)
14
    if (window.cordova && window.cordova.plugins.Keyboard) {
32
    if (window.cordova && window.cordova.plugins.Keyboard) {
15
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
33
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);