Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
  <title></title>



  <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
  <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>


</head>

<body ng-app="starter">
  <!--
      The nav bar that will be updated as we navigate between views.
    -->
  <ion-nav-bar class="bar-dark">
    <ion-nav-back-button>
    </ion-nav-back-button>
  </ion-nav-bar>
  <!--
      The views will be rendered in the <ion-nav-view> directive below
      Templates are in the /templates folder (but you could also
      have templates inline in this html file if you'd like).
    -->
  <ion-nav-view>
    <ion-view view-title="Checkup">
      <ion-content ng-controller="ChkpCtrl">

        <!-- ADDABLE CONTENT START -->
        <div>
          <div class="list" ng-repeat="input in inputs">
            <ng-form name="{{'unitForm' + $index}}">
              <div class="item item-divider">
                Unit Info #{{ $index }}
              </div>
              <label class="item item-input item-select" ng-model="input.value">
                <div class="input-label">
                  Location
                </div>
                <select ng-model="input.Infounitloc" ng-change="unitLocValue(input.Infounitloc)">
                  <option>Ground</option>
                  <option>Roof</option>
                  <option>Window</option>
                </select>
              </label>
              <label class="item item-input item-select">
                <div class="input-label">
                  Type
                </div>
                <select ng-model="input.Infounittype" ng-change="unitTypeValue(input.Infounittype)">
                  <option>PAC</option>
                  <option>Splt</option>
                  <option>Else</option>
                </select>
              </label>
              <label class="item item-input item-select">
                <div class="input-label">
                  Condition
                </div>
                <select ng-model="input.Infounitcond" ng-change="unitCondValue(input.Infounitcond)">
                  <option>Bad</option>
                  <option>Good</option>
                  <option>Great!</option>
                </select>
              </label>
              <label class="item item-input">
                <input class="form-control" ng-model="input.Infounitbrand" type="text" placeholder="Brand">
              </label>

              <label class="item item-input">
                <input type="text" ng-model="input.Infounitmodel" placeholder="Model #">
              </label>
              <label class="item item-input">
                <input type="number" ng-model="input.Infounitage" placeholder="Age">
              </label>
              <label class="item item-input">
                <input type="text" ng-model="input.Infounitbtu" placeholder="BTUs">
              </label>
              <ul class="list">
                <li class="item item-toggle">
                  MFG WARR
                  <label class="toggle toggle-assertive">
                    <input ng-model="input.Infounitmfgwarr" ng-change="unitMfgValue(input.Infounitmfgwarr)" type="checkbox">
                    <div class="track">
                      <div class="handle"></div>
                    </div>
                  </label>
                </li>
              </ul>
              <label class="item item-input item-stacked-label">
                <span class="input-label">Pressures</span>
                <input type="number" ng-model="input.Infounitlsuction" placeholder="Low Suction">
                <input type="number" ng-model="input.Infounithliquid" placeholder="High Liquid">
              </label>
              <label class="item item-input item-stacked-label">
                <span class="input-label">Refrigerant</span>
                <input type="number" ng-model="input.Infounitsheat" placeholder="Superheat">
                <input type="number" ng-model="input.Infounitscool" placeholder="Subcooling">
              </label>
              <label class="item item-input item-stacked-label">
                <span class="input-label">Compressor</span>
                <input type="number" ng-model="input.Infounitcomprated" placeholder="Rated">
                <input type="number" ng-model="input.Infounitcompactual" placeholder="Actual">
              </label>
              <label class="item item-input item-stacked-label">
                <span class="input-label">Condensor Fan</span>
                <input type="number" ng-model="input.Infounitcondrated" placeholder="Rated">
                <input type="number" ng-model="input.Infounitcondactual" placeholder="Actual">
              </label>
              <button ng-click="getPhoto()" class="button button-block button-primary">Take Photo</button>
              <img ng-src="{{input.Pic1}} " style="max-width: 100%">
              <!-- Only Way I get picture to load here is by using $scope.inputs Which loads the picture if another form is added -->
              <button ng-click="getPhoto()" class="button button-block button-primary">Take Photo</button>
              <img ng-src="{{input.Pic2}}" style="max-width: 100%">
              <label class="item item-input">
                <textarea ng-model="input.Infounitcomments" placeholder="Comments"></textarea>
              </label>


              <button class="button button-full button-positive" ng-if="$index == inputs.length - 1" ng-click="addInput($index)">
                <i class="icon ion-plus"></i>
              </button>
              <button class="button button-full button-assertive" ng-if="$index != inputs.length - 1" ng-click="removeInput($index)">
                <i class="icon ion-minus"></i>
              </button>
            </ng-form>
          </div>

        </div>
        <!-- END OF ADDABLE CONTENT -->

        <!-- PICTURES -->

        <!-- END PICTURES _>>
	
	<!-- IAQ Checklist -->
        <div>
          <ul class="list">

            <li class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox">
              </label>
              Duct Leaks
            </li>
            <li class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox">
              </label>
              Ducts Dirty
            </li>
            <li class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox">
              </label>
              Coils Dirty
            </li>
            <li class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox">
              </label>
              Passive Filter
            </li>
            <li class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox">
              </label>
              Active Filter
            </li>
          </ul>
        </div>
        <!-- End of IAQ Checklist -->

        <!-- Submit Information (possibly save in phone storage till invoice submit) & Go to Invoice Page -->
        <div>
          <button class="button button-block button-balanced" ui-sref="tab.invoice" ng-click="storeChkup()">
            Go to Invoice
          </button>

        </div>
      </ion-content>
    </ion-view>
  </ion-nav-view>
</body>

</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                var app1 = angular.module('starter.controllers', [])
app1.controller('ChkpCtrl', function($scope, $http, auth, UnitInfo, Camera) {
  var index = 0;
  //var picture= $scope.unitPhotos.Pic1;
  $scope.inputs = [{
    value: index,
    Infounitloc: '',
    Infounittype: '',
    Infounitcond: '',
    Infounitbrand: '',
    Infounitmodel: '',
    Infounitage: '',
    Infounitbtu: '',
    Infounitmfgwarr: '',
    Infounitlsuction: '',
    Infounithliquid: '',
    Infounitsheat: '',
    Infounitscool: '',
    Infounitcomprated: '',
    Infounitcompactual: '',
    Infounitcondrated: '',
    Infounitcondactual: '',
    Infounitcomments: '',
    Pic1: '',
    Pic2: ''

  }];

  $scope.addInput = function(index) {

    console.log("new input");

    $scope.inputs.push({
      value: index + 1,
      Infounitloc: '',
      Infounittype: '',
      Infounittype: '',
      Infounitbrand: '',
      Infounitmodel: '',
      Infounitage: '',
      Infounitbtu: '',
      Infounitmfgwarr: '',
      Infounitlsuction: '',
      Infounithliquid: '',
      Infounitsheat: '',
      Infounitscool: '',
      Infounitcomprated: '',
      Infounitcompactual: '',
      Infounitcondrated: '',
      Infounitcondactual: '',
      Infounitcomments: '',
      Pic1: '',
      Pic2: ''

    });
  }

  $scope.removeInput = function(index) {
    $scope.inputs.splice(index, 1);
  }
  $scope.unitLocValue = function(InfounitLocW) {
    console.log(InfounitLocW);
    $scope.inputs.Infounitloc = InfounitLocW;
  }
  $scope.unitTypeValue = function(InfounitTypeW) {
    $scope.inputs.Infounittype = InfounitTypeW;
  }
  $scope.unitCondValue = function(InfounitCondW) {
    $scope.inputs.Infocondtype = InfounitCondW;
  }
  $scope.unitMfgValue = function(InfounitMfgW) {
    if (InfounitMfgW) {
      $scope.inputs.Infounitmfgwarr = 'Yes';
    } else {
      $scope.inputs.Infounitmfgwarr = 'No';
    }
  }

  $scope.storeChkup = function(index) {

    console.log('storeChkup ' + JSON.stringify($scope.inputs));

    UnitInfo.save($scope.inputs);

  }

  $scope.getPhoto = function() {

    Camera.getPicture().then(function(imageURI) {

      //Here I need to save to picture in $scope.inputs for each picture taken
      $scope.inputs.Pic1 = imageURI;
      
      console.log('getphoto: ' + JSON.stringify($scope.inputs.Pic1)); //This prints out the file URI
      console.log('inputs full: ' + JSON.stringify($scope.inputs)); //This prints out but NO URI in the inputs.Pic1 . Displayes as  "Pic1 : '' " 

    }, function(err) {
      console.err(err);
    }, {
      quality: 75,
      targetWidth: 320,
      targetHeight: 320,
      saveToPhotoAlbum: true
    });
  }
});

app1.service('UnitInfo', function() {
  var factory = [];

  var photo = [];

  this.savePhotos = function(photos) {
    photo = JSON.stringify(photos);
    // console.log('Service photos' + photo);
  }

  this.save = function(info) {
    factory = JSON.stringify(info);
    //console.log('service' + factory);
  }

  this.get = function() {
    return factory;
  }
})
              
            
!
999px

Console