Skip to content
Browse files

Removed underscore code in favor of angular.forEach to minimize depen…

…dencies.
  • Loading branch information...
1 parent bf6d387 commit 525092e74007500b50931cb2e4b7b34fc39b810d @simpulton committed Jan 9, 2013
Showing with 6 additions and 5 deletions.
  1. +1 −1 package.json
  2. +0 −1 public/index.html
  3. +5 −3 public/js/collab-board.js
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "angular-collab-board",
"description": "AngularJS Collobaration Board",
- "version": "0.0.1",
+ "version": "0.0.1-1",
"private": true,
"dependencies": {
"express": "3.x",
View
1 public/index.html
@@ -7,7 +7,6 @@
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<script src="/js/collab-board.js"></script>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
View
8 public/js/collab-board.js
@@ -89,10 +89,12 @@ app.controller('MainCtrl', function($scope, socket) {
});
socket.on('onNoteUpdated', function(data) {
- var updatedNote = _.find($scope.notes, function(item) {
- return item.id == data.id;
- });
+ var updatedNote;
+ angular.forEach($scope.notes, function(note) {
+ if(note.id === data.id) updatedNote = note;
+ });
+
if(typeof(updatedNote) != "undefined") {
updatedNote.title = data.title;
updatedNote.body = data.body;

0 comments on commit 525092e

Please sign in to comment.
Something went wrong with that request. Please try again.