title: Ascribe string to variables Angular Javascript
body: <p>Here's my json : </p>
  
  <pre><code>[
      {
          "name": "1QQQJohnQQQ11_22_1998",
          "age" : "ads"
      },
      {
          "name": "2QQQEvaQQQ05_01_1989",
          "age" : "ads"
      },
      {
          "name": "3QQQCasperQQQ02_16_1994",
          "age" : "ads"
      },
      {
          "name": "4QQQBeanQQQ30_12_1996",
          "age" : "ads"
      }]
  </code></pre>
  
  <p>I do from that a table, and what i have to do is split "QQQ" from name and change it on 3 strings (ex. "4", "Bean", "30_12_1996"),
  How do it in js file, by ascribe each string to variable (ex. type = "4", name = "Bean", date = "30_12_1996). 
  My js file:</p>
  
  <pre><code>var app = angular.module('app', []);
      app.service('service', function($http, $q){
          var deferred = $q.defer();
  
          $http.get("filejson.json").then(function(data){
              deferred.resolve(data);
          });
  
          this.getNames = function(){
              return deferred.promise;
          }
      });
      app.controller('MainCtrl', function($scope, service){
          var promise = service.getNames();
          promise.then(function(data){
              $scope.names = data.data;
              console.log($scope.names);
          });
    //*what i try to do (it didn't works):
   var type = names.name.split('QQQ')[0];
   var name= names.name.split('QQQ')[1];
   var date= names.name.split('QQQ')[2];
   //*
  });
  </code></pre>