Regular Expression Crossword

122 views
Skip to first unread message

Clint Checketts

unread,
Feb 18, 2013, 12:03:23 PM2/18/13
to ang...@googlegroups.com
regcross
Last week I saw several links to a 'regular expression crossword'. For fun I played with implementing a simplified version using Angular.

http://plnkr.co/edit/G4A095VkyqqYGvsjqMCl?p=preview (pardon the extremely basic regex)

Eventually maybe I'll move it to Github and polish it up to the hexogonal goodness.

Here is my question: Is this the best way to setup a 'deep watch' on each text field?

  for(var i =0;i<$scope.game.board.length;i++){
    var word = $scope.game.board[i];
    for(var j=0;j<word.length;j++){
      $scope.$watch("game.board["+i+"]["+j+"].letter",makeCheckWordHandler(i,j));
    }
  }



Peter Bacon Darwin

unread,
Feb 18, 2013, 12:53:26 PM2/18/13
to ang...@googlegroups.com
That is not a "deep watch" in my understanding.  You are creating lots of shallow watches.  A deep watch would simply watch game.board.
I think you are right to do it this way though!
Alternatively you could create your own directive for each crossword cell that reacted to a change of value.
Pete


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages