
var app = angular.module('LandingPageApp', [
  'ngMaterial',
  'ui.router'
  ]);

var storageKey = 'CMS';

app.config(function($mdThemingProvider) {
    $mdThemingProvider.theme('default')
      .primaryPalette('blue-grey')
      .accentPalette('amber');
});

app.controller('MainController', ['$scope', '$interval', function($scope, $interval) {

    $scope.subscribe = function() {
      $scope.showProgress = true;
      $scope.subscribe_btn = true;
      $scope.determinateValue = 10;
      $interval(function() {
        $scope.determinateValue += 10;
        if ($scope.determinateValue > 100) {
          $scope.determinateValue = 10;
          $scope.showProgress = false;
          $scope.thankyou = true;
        }
      }, 100, 0, true);
    };

    $scope.product = {
      caption: "We have all the Best Stories",
      name: "Best Story Books",
      description: "So, what is the secret of successful description.",
      pubDate: new Date(),
      image: 'http://srobbin.com/wp-content/uploads/2012/05/books.jpg'
    };

    // try {
    //   $scope.product = JSON.parse(localStorage.getItem(storageKey));
    //   $scope.product.image = 'http://srobbin.com/wp-content/uploads/2012/05/books.jpg';
    // } catch(e) {
    //   console.log(e);
    // }
    
  }]);

app.controller('AdminController', ['$scope', function($scope) {

  try {
    $scope.data = JSON.parse(localStorage.getItem(storageKey));
  } catch(e) {
    console.log(e);
  }

  $scope.publish = function(data){
    data.created_at = new Date().getTime();
    localStorage.setItem(storageKey, JSON.stringify(data));
  };

}]);


 app.config(function($stateProvider, $urlRouterProvider){

  $urlRouterProvider.otherwise("/");

  $stateProvider
    .state('home', {
      url: "/",
      templateUrl: "views/index.html",
      controller: 'MainController'
    })
    .state('admin', {
      url: "/admin",
      templateUrl: "views/admin.html",
      controller: 'AdminController'
    });

 });

@@ -1034,19 +1034,16 @@
  %7D;%0A%0A   
- //
  try %7B%0A 
@@ -1040,27 +1040,24 @@
    try %7B%0A   
- //
    $scope.pr
@@ -1113,19 +1113,16 @@
 y));%0A   
- //
    $scop
@@ -1201,19 +1201,16 @@
 pg';%0A   
- //
  %7D catch
@@ -1223,13 +1223,10 @@
     
-//
   
- 
 cons
@@ -1244,11 +1244,8 @@
 %0A   
- //
  %7D%0A 

Update app.js