Catch the empty string case.
Actually set nodes in withNodes
Fix difficult issue with Typescipt this pointer and $scope.