I think you need to use the "=" isolate scope option in your directive to achieve this. From my understanding, this allows you to bind your controller property to your directive and vice versa.
You would need to change your countdown attr to use the controller object:
<timer interval="1000" countdown="countdown">{{minutes}}:{{seconds}}</timer>
Your controller would look something like this:
app.controller("TimerCtrl", function($scope) {
$scope.timerRunning = true;
$scope.countdown = 10;
});
And your directive would be something along the lines of:
app.directive("timer", function() {
return {
restrict: "E",
transclude: true,
scope: {
countdown: "="
},
template: '<div ng-transclude></div>',
link: function (scope, element) {
scope.incrementCountdown = function (amount) {
scope.countdown += parseint(amount, 10);
}
// something that would trigger the increment, could be whatever
element.bind('click', function () {
scope.incrementCountdown(10); // could also pull the param value from an attribute on your directive
});
}
}
});
This way if you change the countdown within the scope of your directive it should update the model in your controller as well.
I haven't run this code so it may not be error free and I'm an Angular n00b, so hopefully I'm not leading you astray, but I'm sure someone else will chime in if this is wrong. Good luck.