title: Why $scope.data.task is undefine?
body: <p>I have a select that I fill with a function in angular. But when I reload the page (f5) the $ scope.data.tasks is undefined
  This is my html</p>
  
  <pre><code>&lt;div class="col-sm-3"&gt;
  &lt;label&gt;
  &lt;select class="w-full form-control col-sm-10" ng-model="data.category"  ng-options="cantTasksByCat(category) for category in categoriesEx  | orderBy:'title'" &gt;&lt;/select&gt;
  &lt;/label&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>this is my js</p>
  
  <pre><code>app.controller('TasksCtrl', ['$scope',  'api', 'toaster', function($scope, api, toaster, ) {
     $scope.data = {
    tasks: [],
    category: tempCat,
    selectedTask: null
  
  };
  $scope.data.tasks = $scope.tasks;
  
  $scope.cantTasksByCat = function (cat) {
    let cantTasksByCategory;
    if (cat.title.en==='View all'){
      cantTasksByCategory= $scope.tasks;
      return " (" + cantTasksByCategory.length + ")";
    }  
    cantTasksByCategory = $scope.tasks.filter(function(obj) {
      return obj.category.objectId== cat.objectId;
  });
    return " (" + cantTasksByCategory.length + ")"; };}]);
  </code></pre>
  
  <p>I want to load
  <a href="https://i.stack.imgur.com/anN4q.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>The select fills up correctly, but when I reload the browser (f5), it flags me an error. $ Scope.data.tasks is undefined.Like that has not yet been able to get the request</p>