Skip to content
Snippets Groups Projects
Commit a72503b3 authored by Devin Alvaro's avatar Devin Alvaro
Browse files

Ensure chat is not empty before pushing to chatList

parent 4c45161b
Branches
No related merge requests found
<%@ include file="/component/header.html"%>
<%@ include file="/component/nav.html"%>
<div class = "container" ng-app="myApp">
<%@ include file="/component/header.html" %>
<%@ include file="/component/nav.html" %>
<div class="container" ng-app="chatApp">
<div class="wrapper row">
<div>
<div class="page-title row txt-center height-fit float-container">
......@@ -22,11 +23,11 @@
</li>
<li class="order-item active">
<div class="order-number">3</div>
<div class="order-number-desc"><span>Chat Driver</div>
<div class="order-number-desc">Chat Driver</div>
</li>
<li class="order-item">
<div class="order-number">4</div>
<div class="order-number-desc"><span>Complete your order</div>
<div class="order-number-desc">Complete your order</div>
</li>
</ul>
</div>
......@@ -54,26 +55,27 @@
<input type="submit" class="close-button" value="CLOSE">
</form>
</div>
</div>
</div>
<%@ include file="/component/footer.html" %>
</div>
<%@ include file="/component/footer.html"%>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js"></script>
<script>
window.onload = toggleActive("nav-order");
</script>
<script>
angular.module('myApp', [])
.controller('chatController', function() {
angular.module('chatApp', [])
.controller('chatController', function () {
var chatList = this;
chatList.chats = [];
chatList.addChat = function() {
chatList.chats.push({text:chatList.chatText});
chatList.addChat = function () {
if (chatList.chatText.length !== 0) {
chatList.chats.push({text: chatList.chatText});
}
chatList.chatText = '';
};
});
</script>
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment