Use AngularJS factory to create minefield.