angular-timer
angular-timer copied to clipboard
Binding autostart to the $scope.
Hi people!, i have a ng-repeat directive where each row has a timer like this (Jade):
timer(ng-attr-id='{{travel._id}}', autostart='travel.departed', interval='1000', countdown='travel.googleDuration - currentTimes[travel._id]') {{hours}} hs, {{minutes}} min, {{seconds}} seg.
The autostart property is not working as expect because is passed as string instead of evaluating the expression. I probe with ng-attr-autostart and {{}} and with autostart={{}} too but i get:
Error: [$parse:syntax] Syntax Error: Token 'travel.departed' is unexpected, expecting [:] at column 3 of the expression [{{travel.departed}}] starting at [travel.departed}}]. http://errors.angularjs.org/1.2.21/$parse/syntax?p0=travel.departed&p1=is%2…g%20%5B%3A%5D&p2=3&p3=%7B%7Btravel.departed%7D%7D&p4=travel.departed%7D%7D at http://localhost:3000/bower_components/angular/angular.js:78:12 at Parser.throwError (http://localhost:3000/bower_components/angular/angular.js:10496:11) at Parser.consume (http://localhost:3000/bower_components/angular/angular.js:10530:12) at Parser.object (http://localhost:3000/bower_components/angular/angular.js:10844:14) at Parser.primary (http://localhost:3000/bower_components/angular/angular.js:10466:22) at Parser.unary (http://localhost:3000/bower_components/angular/angular.js:10719:19) at Parser.multiplicative (http://localhost:3000/bower_components/angular/angular.js:10702:21) at Parser.additive (http://localhost:3000/bower_components/angular/angular.js:10693:21) at Parser.relational (http://localhost:3000/bower_components/angular/angular.js:10684:21) at Parser.equality (http://localhost:3000/bower_components/angular/angular.js:10675:21)
Is there a way to pass a expression or scope value to autostart? Thanks!
This is a serious problem, I'm having the same issue.
I am also facing this issue.