使用角度错误

我正在尝试学习angular,并且在尝试运行此代码时遇到以下错误。

  1. 意外的标记。预期使用构造函数,方法,访问器或属性。
  2. 逗号运算符的左侧未使用且没有副作用。
  3. 需要声明或声明。
export class AppComponent {
  var app = ('app', ['ngAnimate'])

  app.controller('mainCtrl', function($scope) {
    $scope.boxes = [{
      name: 'Friends',
      image: 'https://source.unsplash.com/uAgLGG1WBd4/900x900'
    },{
      name: 'Free',
      image: 'https://source.unsplash.com/Cp-LUHPRpWM/900x900'
    },{
      name: 'Explore',
      image: 'https://source.unsplash.com/7BjmDICVloE/900x900'
    }, {
      name: 'Vast',
      image: 'https://source.unsplash.com/WLUHO9A_xik/900x900'
    }, {
      name: 'Playful',
      image: 'https://source.unsplash.com/b2-fBVrfx0o/900x900'
    }, {
      name: 'Grand',
      image: 'https://source.unsplash.com/Ixp4YhCKZkI/900x900'
    }, {
      name: 'Mist',
      image: 'https://source.unsplash.com/8BmNurlVR6M/900x900'
    }, {
      name: 'Sea',
      image: 'https://source.unsplash.com/6YqpFWWQsno/900x900'
    }, {
      name: 'Reach',
      image: 'https://source.unsplash.com/zFnk_bTLApo/900x900'
    }, {
      name: 'Awe',
      image: 'https://source.unsplash.com/j4PaE7E2_Ws/900x900'
    }, {
      name: 'Surf',
      image: 'https://source.unsplash.com/uohGiEVhWiQ/900x900'
    }, {
      name: 'Thrill',
      image: 'https://source.unsplash.com/ssrbaKvxaos/900x900'
    }, ];

    $scope.selected = [];
    $scope.selectBox = function(item, position) {
      $scope.selected = [{
        item: item,
        position: position
      }];
      $scope.$apply();
    }
    $scope.clearSelection = function() {
      $scope.selected = [];
    }
  })
}