JSFiddle - React, Tailwind, and code Playground
Using the $watch function to copy data.
HTML
<div ng-app="shippingApp" ng-controller="ShippingCtrl">
<h4>Shipping Information</h4>
<input type="text" ng-model="mailing.first">
<br>
<input type="text" ng-model="mailing.last">
<br>
<input type="text" ng-model="mailing.address1">
<br>
<input type="text" ng-model="mailing.city">
<hr>
<h4>Billing Information</h4>
<input type="checkbox" ng-model="billing_same">Same as shipping
<br>
<input type="text" ng-model="billing.first">
<br>
<input type="text" ng-model="billing.last">
<br>
<input type="text" ng-model="billing.address1">
<br>
<input type="text" ng-model="billing.city">
</div>
JavaScript
var app = angular.module('shippingApp', []);
app.controller('ShippingCtrl', function ($scope) {
$scope.mailing = {
first: 'Jon',
last: 'Doe',
address1: '123 Main Street',
city: ''
};
$scope.billing_same = false;
$scope.$watch('billing_same', function () {
if ($scope.billing_same) {
$scope.billing = $scope.mailing;
} else {
$scope.billing = {};
}
});
});