SHARE
TWEET

Untitled

a guest Dec 5th, 2014 156 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. angular.module('myApp')
  4.   .controller('MyCtrl', function ($scope, $location, $stateParams, DeviceService, $filter) {
  5. $scope.expPath =
  6.     {
  7.       'Smartphone': false,
  8.       'Tablet': false,
  9.       'Laptop': false,
  10.       'Desktop': false,
  11.       'HDTV': false
  12.     };
  13. $scope.setExpPath = function(device)
  14.     {
  15.       console.log(device);
  16.       if($scope.expPath[device] == false)
  17.       {
  18.         $scope.expPath[device] = true;
  19.         console.log($scope.expPath[device]) //returns true
  20.       } else {
  21.         $scope.expPath[device] = false;
  22.         console.log($scope.expPath[device])
  23.       }
  24.     }
  25. $scope.getShare = function()
  26.     {
  27.       console.log($scope.expPath['Smartphone']); //returns false
  28.     }  
  29.   });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top