Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- angular.module('starter.controllers', ['ngCordova'])
- .controller('AppCtrl', function($scope, $ionicModal, $timeout, $ionicPlatform,$cordovaDevice) {
- // Form data for the login modal
- $scope.loginData = {};
- // Create the login modal that we will use later
- $ionicModal.fromTemplateUrl('templates/login.html', {
- scope: $scope
- }).then(function(modal) {
- $scope.modal = modal;
- });
- $scope.device = ionic.Platform.device();
- $scope.uuid = $scope.device.uuid;
- // localStorage.setItem("uuid", uuid);
- console.log($scope.device);
- console.log($scope.uuid);
- // ionic.Platform.ready(function() {
- // var device = ionic.Platform.device();
- // // alert(device.platform);
- // var foo = $cordovaDevice.getUUID();
- // alert(foo);
- // });
- if( ionic.Platform.isAndroid() ){
- $scope.loginData.uuid=$cordovaDevice.getModel();
- // alert($cordovaDevice.getModel());
- // alert($cordovaDevice.getUUID());
- }else{
- console.log("Is not Android");
- // alert("windows");
- // alert("testUUID");
- }
- $scope.cats={
- "MOBILES & TABLETS": [
- "Mobiles",
- "Tablets",
- "Mobile Cases & Covers",
- "Earphones",
- "Memory Cards",
- "Mobile Accessories",
- "Value Added Services",
- "Power Banks",
- "Tablet Accessories",
- "Bluetooth Devices",
- "Mobile Screen Guards",
- "Batteries",
- "Cables & Chargers",
- "Mobile Spare Parts",
- "Digital Goods"
- ],
- "COMPUTERS & PERIPHERALS": [
- "Laptops",
- "Desktops",
- "Pen Drives",
- "External Hard Disks",
- "Software",
- "Printers & Scanners",
- "Routers & Modems",
- "Data Cards",
- "Mouse",
- "Monitors",
- "Computer Accessories",
- "Computer Components",
- "Internal Hard Drives",
- "RAM",
- "Processor",
- "Graphics Card",
- "Cooling Pads/Laptop Tables",
- "Headphones & Mics",
- "Adapters",
- "Laptop Batteries",
- "Value Added Services",
- "Webcams",
- "Speakers",
- "Keyboard"
- ],
- "HOME FURNISHING": [
- "Bed Linen",
- "Bath Linen",
- "Curtains & Accessories",
- "Mattresses",
- "Pillows & Covers",
- "Mats & Carpets",
- "Cushions & Covers",
- "Blankets & Quilts",
- "Table & Kitchen Linen",
- "Kids Bedding & More",
- "Fabrics"
- ],
- "CLOTHING": [
- "Shirts",
- "T Shirts",
- "Polo T Shirts",
- "Sweaters",
- "Sweatshirts",
- "Jackets",
- "Jeans",
- "Trousers & Chinos",
- "Suitings & Shirtings",
- "Kurtas, Pyjamas & Sherwanis",
- "Plus Sizes",
- "Suits & Blazers",
- "Innerwear & Sleepwear",
- "Trackpants & Tracksuits",
- "Shorts & 3/4ths",
- "Nightwear"
- ]
- };
- $scope.deals=[
- {
- dealcategory: "Cloth",
- dealenddate: "2014-12-10",
- dealname: "Buy 1 get 1 Free",
- dealstartdate: "2014-12-03",
- dealsubcategory: "Men",
- description: "Discount Deal",
- id: 1
- },
- {
- dealcategory: "Cloth",
- dealenddate: "2014-12-14",
- dealname: "Buy 1 Get 1",
- dealstartdate: "2014-12-13",
- dealsubcategory: "Men",
- description: "Discount Deal",
- id: 2
- },
- {
- dealcategory: "Cloth",
- dealenddate: "2014-12-17",
- dealname: "Buy Mobile With 20% Offer",
- dealstartdate: "2014-12-15",
- dealsubcategory: "Men",
- description: "Discount Deal",
- id: 3
- },
- {
- dealcategory: "Cloth",
- dealenddate: "2014-12-17",
- dealname: "Buy 1 get 3 free",
- dealstartdate: "2014-12-03",
- dealsubcategory: "Women",
- description: "Discount Deal",
- id: 4
- },
- {
- dealcategory: "Electronics",
- dealenddate: "2014-12-25",
- dealname: "Free ! Free!",
- dealstartdate: "2014-12-24",
- dealsubcategory: "Mobile",
- description: "Discount Deal",
- id: 5
- }
- ];
- $scope.login_success=function(){
- window.location.href = "#/app/search";
- }
- // Triggered in the login modal to close it
- $scope.closeLogin = function() {
- $scope.modal.hide();
- };
- // Open the login modal
- $scope.login = function() {
- $scope.modal.show();
- };
- // Perform the login action when the user submits the login form
- $scope.doLogin = function() {
- console.log('Doing login', $scope.loginData);
- // Simulate a login delay. Remove this and replace with your login
- // code if using a login system
- $timeout(function() {
- $scope.closeLogin();
- }, 1000);
- };
- })
- .controller('PlaylistsCtrl', function($scope) {
- $scope.playlists = [
- { title: 'Reggae', id: 1 },
- { title: 'Chill', id: 2 },
- { title: 'Dubstep', id: 3 },
- { title: 'Indie', id: 4 },
- { title: 'Rap', id: 5 },
- { title: 'Cowbell', id: 6 }
- ];
- })
- .controller('PlaylistCtrl', function($scope, $stateParams) {
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement