{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/361","repository_url":"https://api.github.com/repos/ga-wdi-exercises/project3","labels_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/361/comments","events_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/361/events","html_url":"https://github.com/ga-wdi-exercises/project3/issues/361","id":193533549,"number":361,"title":"Checkbox and Textbox form","user":{"login":"julietberman","id":17633399,"avatar_url":"https://avatars.githubusercontent.com/u/17633399?v=3","gravatar_id":"","url":"https://api.github.com/users/julietberman","html_url":"https://github.com/julietberman","followers_url":"https://api.github.com/users/julietberman/followers","following_url":"https://api.github.com/users/julietberman/following{/other_user}","gists_url":"https://api.github.com/users/julietberman/gists{/gist_id}","starred_url":"https://api.github.com/users/julietberman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julietberman/subscriptions","organizations_url":"https://api.github.com/users/julietberman/orgs","repos_url":"https://api.github.com/users/julietberman/repos","events_url":"https://api.github.com/users/julietberman/events{/privacy}","received_events_url":"https://api.github.com/users/julietberman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-05T15:48:25Z","updated_at":"2016-12-05T16:22:06Z","closed_at":null,"body":"Unsure how to proceed with two-way binding/data submission on a form that has checklist items using a separate dependency (\"checklist-model\" dependency) from the text input box.\r\n\r\nThe goal is to have one form which, upon submit, data from the input textbox and the checkboxes (only if checked!) is captured (eventually to be passed to a backend).\r\n\r\nLots of googling and stackoverflow and unsure how to proceed. Here is the code so far:\r\n\r\nIndex.html file as part of ng-views\r\n```\r\n<div id=\"intro\">\r\n  <h2>Enter your location below</h2>\r\n  <form id = \"zipcodeform\" data-ng-submit=\"vm.create()\">\r\n\r\n      <input type=\"text\" name=\"postal_code\" placeholder=\"ZIPCODE\"  data-ng-model=\"vm.newEvent.event_title\"><br/>\r\n    <section>\r\n      <div class=\"icons\">\r\n        <label ng-repeat=\"category in categories\">\r\n          <div class=\"circle\">\r\n            <input type=\"checkbox\" checklist-model=\"user.categories\" checklist-value=\"category\"> {{category}}\r\n          </div>\r\n        </label>\r\n      </div>\r\n    </section>\r\n      <button type=\"submit\">Let's Go!</button>\r\n  </form>\r\n\r\n  <br/>\r\n  {{user.categories}}\r\n</div>\r\n```\r\n\r\nAngular app.js file\r\n```\r\nangular\r\n  .module(\"heyimbored\", [\"ui.router\", \"checklist-model\"])\r\n  .config([\"$stateProvider\", RouterFunction])\r\n  .controller(\"IndexController\", [\"$scope\", IndexControllerFunction])\r\n\r\nfunction RouterFunction($stateProvider) {\r\n  $stateProvider\r\n    .state(\"index\", {\r\n      url: \"/\",\r\n      templateUrl: \"/js/ng-views/index.html\",\r\n      controller: \"IndexController\",\r\n      controllerAs: \"vm\"\r\n    })\r\n}\r\n\r\nfunction IndexControllerFunction($scope) {\r\n  // this.newUserInput = new EventFactory();\r\n  // this.create = function() {\r\n  //     this.newUserInput.save().then(function(event){\r\n  //       $state.go(\"index\")\r\n  //     })\r\n  //   }\r\n  $scope.categories = [\r\n    'music',\r\n    'comedy',\r\n    'sports',\r\n    'arts',\r\n    'food',\r\n    'family'\r\n  ];\r\n  $scope.user = {\r\n    categories: []\r\n  };\r\n\r\n\r\n  this.create = function(){\r\n\r\n    console.log(\"submit button\")\r\n      // this.songs.$add(this.newSong).then( () => this.newSong = {} )\r\n  }\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/comments/264899288","html_url":"https://github.com/ga-wdi-exercises/project3/issues/361#issuecomment-264899288","issue_url":"https://api.github.com/repos/ga-wdi-exercises/project3/issues/361","id":264899288,"user":{"login":"julietberman","id":17633399,"avatar_url":"https://avatars.githubusercontent.com/u/17633399?v=3","gravatar_id":"","url":"https://api.github.com/users/julietberman","html_url":"https://github.com/julietberman","followers_url":"https://api.github.com/users/julietberman/followers","following_url":"https://api.github.com/users/julietberman/following{/other_user}","gists_url":"https://api.github.com/users/julietberman/gists{/gist_id}","starred_url":"https://api.github.com/users/julietberman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julietberman/subscriptions","organizations_url":"https://api.github.com/users/julietberman/orgs","repos_url":"https://api.github.com/users/julietberman/repos","events_url":"https://api.github.com/users/julietberman/events{/privacy}","received_events_url":"https://api.github.com/users/julietberman/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T16:22:06Z","updated_at":"2016-12-05T16:22:06Z","body":"We just got it to work! Disregard, but thank you"}}
{"actor":{"display_login":"julietberman"}}