I'm diving into the world of Angular and encountering some errors as I try to execute this code.
- An unexpected token is causing trouble. A constructor, method, accessor, or property was expected.
- The left side of a comma operator seems to be unused with no side effects.
- There appears to be a missing declaration or statement in the code.
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 = [];
}
})
}