Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
[fix] Empty Chat Messages
Browse files Browse the repository at this point in the history
Disables the submit button on the Chat form, when no message is present.
Also, removed the `data-` prefix from the various Chat view elements.
  • Loading branch information
mleanos committed Aug 25, 2015
1 parent 979c4e5 commit 8128570
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions modules/chat/client/views/chat.client.view.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<!-- The chat view -->
<section class="container" data-ng-controller="ChatController">
<section class="container" ng-controller="ChatController">
<div class="page-header">
<h1>Chat Example</h1>
</div>
<!-- The message form -->
<form class="col-xs-12 col-md-offset-4 col-md-4" ng-submit="sendMessage();">
<fieldset class="row">
<div class="input-group">
<input type="text" id="messageText" name="messageText" class="form-control" data-ng-model="messageText" placeholder="Enter new message">
<input type="text" id="messageText" name="messageText" class="form-control" ng-model="messageText" placeholder="Enter new message">
<span class="input-group-btn">
<button type="submit" class="btn btn-primary">Submit</button>
<button type="submit" class="btn btn-primary" ng-disabled="!messageText.length">Submit</button>
</span>
</div>
</fieldset>
</form>
<ul class="list-unstyled">
<!-- List all messages -->
<li class="col-xs-12 col-md-offset-4 col-md-4 chat-message" data-ng-repeat="message in messages">
<small class="pull-right text-muted" data-ng-bind="message.created | date:'mediumTime'"></small>
<img data-ng-src="{{message.profileImageURL}}" alt="{{message.username}}" class="pull-left chat-profile-image" />
<li class="col-xs-12 col-md-offset-4 col-md-4 chat-message" ng-repeat="message in messages">
<small class="pull-right text-muted" ng-bind="message.created | date:'mediumTime'"></small>
<img ng-src="{{message.profileImageURL}}" alt="{{message.username}}" class="pull-left chat-profile-image" />
<div class="pull-left chat-message-details">
<strong data-ng-bind="message.username"></strong>
<strong ng-bind="message.username"></strong>
<br>
<span data-ng-bind="message.text"></span>
<span ng-bind="message.text"></span>
</div>
</li>
</ul>
Expand Down

0 comments on commit 8128570

Please sign in to comment.