JSFiddle - React, Tailwind, and code Playground
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example - example-checkbox-input-directive-production</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0-rc.1/angular.min.js"></script>
</head>
<body ng-app="checkboxExample">
<div ng-controller="ExampleController">
<input type="checkbox" ng-model="titleChanged" ng-change="titleChange()" >Checkbox
</div>
</body>
</html>
JavaScript
angular.module('checkboxExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.titleChanged = false;
$scope.titleChange = function() {
if ($scope.titleChanged) {
alert("in");
//$scope.addTitle(cpPortfolioItem);
} else {
alert("out");
//$scope.removeTitle(cpPortfolioItem);
}
}
}]);