Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
angularJs - two way binding
<!DOCTYPE html>
<html xmlns="" ng-app>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<input type="number" class="form-control" id="productPrice" placeholder="價格"
<label > {{ newProduct.price}}</label>
<script src="../../node_modules/grunt-protractor-webdriver/bower_components/angular/angular.js"></script>
angular.module('app', []);
/*** 請移除scope,更換為controllerAs ***/
.controller('MainController', function ($scope) {
$scope.newProduct = {
name: '',
price: null
/*** end ***/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment