Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
  <head>
    <!-- Twitter bootstrap -->
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.css" rel="stylesheet">
    <!-- apiCheck is used by formly to validate its api -->
    <script src="//rawgit.com/kentcdodds/api-check/master/dist/api-check.js"></script>
    <!-- This is the latest version of angular (at the time this template was created) -->
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.1/angular.js"></script>
    
    <!-- This is the current state of master for formly core. -->
    <script src="//rawgit.com/formly-js/angular-formly/master/dist/formly.js"></script>
    <!-- This is the current state of master for the bootstrap templates -->
    <script src="//rawgit.com/formly-js/angular-formly-templates-bootstrap/master/dist/angular-formly-templates-bootstrap.js"></script>
    <!-- additional dependencies go here -->
    
    <title>Angular Formly Question</title>
  </head>
  <body ng-app="formlyQuestion" ng-controller="MainCtrl as vm">
    <div>
      <h1>
        angular-formly-templates-bootstrap issue
        <a ng-if="vm.issueNumber" ng-href="{{vm.issueLink}}">{{vm.issueNumber}}</a>
      </h1>
      <small>
        angular: {{vm.env.angularVersion}} |
        angular-formly: {{vm.env.formlyVersion}}
      </small>
      <div>
        <h2>
          Steps to report an issue
          <small>(or to request a feature)</small>
        </h2>
        <p>
          In the first case, I predefine checkbox values in options array, and then I simulate async population of the values and in the UI we can see checked checkbox. In the second case I simulate async loading of the checkbox values and when I populate values, the checkbox is not checked.  
        </p>
      </div>
      <hr />
      <div>
        <h2>Form</h2>
        <form ng-submit="vm.onSubmit()" name="vm.form" novalidate>
          <formly-form model="vm.model" fields="vm.fields" options="vm.options" form="vm.form">
            <button type="submit" class="btn btn-primary submit-button" ng-disabled="vm.form.$invalid">Submit</button>
            <button type="button" class="btn btn-default" ng-click="vm.options.resetModel()">Reset</button>
          </formly-form>
        </form>
      </div>
      <hr />
      <div>
        <h2>Model Value</h2>
        <pre>{{vm.model | json}}</pre>
      </div>
      
      <hr />
      
      <div>
        <h2>Form</h2>
        <pre>{{vm.form | json}}</pre>
      </div>
      
      <hr />
      <div>
        <h2>Fields <small>(note, functions are not shown)</small></h2>
        <pre>{{vm.originalFields | json}}</pre>
      </div>
      
      <hr />
      
      <div>
        <h2>Form State</h2>
        <pre>{{vm.options.formState | json}}</pre>
      </div>
    </div>
    <!-- Put custom templates here -->
  </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
m0t0rpro
0viewers