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.2.1/angular.min.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, $interval) {
$scope.secondsCounter = 0;
$interval(function () {
$scope.secondsCounter = $scope.secondsCounter + 1;
}, 1000);
});