AngularJS - ngModel in nested directives
Simple example for StackOverflow (http://stackoverflow.com/questions/19429958/passing-ng-model-in-nested-directives)
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.js"></script>
<div ng-app="MyApp" ng-controller="MyCtrl">
<span>Sono passati {{secondsCounter}} secondi!</span>
</div>
CSS
body {
padding: 20px;
}
JavaScript
angular.module('MyApp', []).controller('MyCtrl', function ($scope) {
$scope.secondsCounter = 0;
setInterval(function () {
$scope.secondsCounter = $scope.secondsCounter + 1;
$scope.$apply();
}, 1000);
});