JSFiddle - React, Tailwind, and code Playground
by Sathya_da
HTML
<div ng-app="app" ng-controller="demo">
<input type='checkbox' ng-click='showEligibleOffer($event)' ng-model='showOffer' />
<p ng-if='showOffer'>
hello
</p>
</div>
JavaScript
angular.module("app", [])
.controller("demo", function($scope) {
function another() {
$scope.baseProduct = {
prop1: 'ABC',
prop2: 'DEF',
prop3: 'GHI',
// need to add newProp: true through showEligibleOffer()
}
}
$scope.showEligibleOffer = function(e) {
console.log('what is hre', e.target.checked)
$scope.showOffer = !$scope.showOffer;
var evt = e.target.checked;
if ($scope.showOffer) {
$scope.baseProduct = {
newProp: evt
}
}
console.log('new prop', $scope.baseProduct);
}
});