javascript - Submit multiple form values with AngularFire -
I try to understand how angular frames work. I am trying to save a first name and last name in my Firefox database. I successfully created a "first name" input and saved it in firebase. Now I try to add one last name input, but I can not understand how it works. Even what I do now:
HTML
& lt; Section ng-controller = "premiercontrolleur" & gt; & Lt; Ul & gt; & Lt; Li ng-repeat = "customer in customer" & gt; & Lt; Input ng-model = "client.prenom" ng-change = "client. $ Save (client)" /> & Lt; Input NG-model = "client.nom" ng-change = "client. $ Save (client)" /> & Lt; Button ng-click = "client. $ Extract (client)" & gt; X & lt; / Button & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; Form ng-submit = "addClient (newClientText)" & gt; & Lt; Input type = "text" placeholder = "prima" ng-model = "newClientText.prenom" /> & Lt; Input type = "text" placeholder = "no day family" ng-model = "newClientText.nom" /> & Lt; Button type = "submit" & gt; Ajoeter Le Client & lt; / Button & gt; & Lt; / Form & gt; & Lt; / Section & gt; javascript
var app = angular Module ("chromefirebase", ["firebase"]); App.controller ("premiercontrolleur", function ($ radius, $ firebase) {var ref = new firebase ("https://mydirebaseurl.firebaseio.com/clients") var var == $ firebase (ref); client = sync . $ AsArray (); $ scope.addClient = function (prenom) {$ scope.clients. $ Add ({prenom: prenom, name: nom});}}); I received this error when I submitted: Failed to read 'selection direction' property from 'HTMLInputElement': type of input element ('submit') does not support selection
You are not mixing the values well, remember that Péren is an object with which Try the properties and names, then try:
$ scope.addClient = function (prenom) {$ scope.clients. $ Add ({prenom: prenom.prenom, nom: prenom.nom}); }
Comments
Post a Comment