day one build

This commit is contained in:
2018-02-26 23:14:37 -05:00
parent 4196aa268a
commit c425c1542f
38 changed files with 13284 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRoute } from '@angular/router';
import { GamesService } from '../games.service';
declare var jquery:any;
declare var $ :any;
declare var masonry:any;
@Component({
selector: 'app-game-grid',
templateUrl: './game-grid.component.html',
styleUrls: ['./game-grid.component.css']
})
export class GameGridComponent implements OnInit {
gameListSubscription;
rawGamesContent;
gamesData;
constructor(
private route: ActivatedRoute,
private gamesService: GamesService
){
}
ngOnInit() {
this.getGamesList();
}
getGamesList(): any{
this.gameListSubscription = this.gamesService.getGames( ).subscribe( data => {
console.log( data );
this.gamesData = data.games;
//var tempItemContent = [];
/* parse out just the input data and set that in object array */
/*for( var key in data['ContentBlocks'] ){
console.log( data['ContentBlocks'][key]['Type'] );
if( data['ContentBlocks'][key]['Type'] == "ItemSelectionSetting" ){
tempItemContent.push( data['ContentBlocks'][key]['Content'] );
}
}
this.formItemContent = tempItemContent;
*/
});
}
isEmptyObject(obj) {
return (obj != undefined);
}
isNotEmptyObject(obj) {
return (obj == undefined);
}
renderGridItems(lastItem: boolean) {
if (lastItem) {
$('.grid').masonry({
columnWidth: '.grid-sizer',
itemSelector: '.grid-item',
percentPosition: true
});
}
}
}