diff --git a/.gitignore b/.gitignore index 8ee8c35..32b781d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ bower_components .atomignore .idea -node_modules \ No newline at end of file +node_modules +.c9 +.git \ No newline at end of file diff --git a/bower.json b/bower.json index cf57510..042de6c 100644 --- a/bower.json +++ b/bower.json @@ -26,7 +26,8 @@ ], "main": [ "src/scripts/index.js", - "src/css/style.css" + "src/css/style.css", + "src/scripts/templates.js" ], "dependencies": { "angular": "~1.3.x", diff --git a/package.json b/package.json index 2889f59..6916e9d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "angular-bootstrap-simple-chat", - "version": "0.4.0", + "version": "0.4.1", "description": "Simple Chat Directive for AngularJS with Bootstrap with infinite scroll", "main": "gulpfile.js", "dependencies": { @@ -15,8 +15,8 @@ }, "repository": { "type": "git", - "url": "https://github.com/irontec/angular-bootstrap-simple-chat" + "url": "https://github.com/smirciat/angular-bootstrap-simple-chat" }, "license": "MIT", - "homepage": "https://github.com/irontec/angular-bootstrap-simple-chat" + "homepage": "https://github.com/smirciat/angular-bootstrap-simple-chat" } diff --git a/src/scripts/index.js b/src/scripts/index.js index 0b9895c..f2a1e7f 100644 --- a/src/scripts/index.js +++ b/src/scripts/index.js @@ -96,6 +96,9 @@ }, 250); }); $scope.$watch('messages.length', function() { + //seems unnecessary, but it solved my problem. Link between this.messages and $scope.messages was lost after initialization + vm.messages = $scope.messages; + if (!$scope.historyLoading) scrollToBottom(); // don't scrollToBottom if just loading history if ($scope.expandOnNew && vm.isHidden) { toggle(); diff --git a/src/scripts/templates.js b/src/scripts/templates.js index b423567..82c0568 100644 --- a/src/scripts/templates.js +++ b/src/scripts/templates.js @@ -1 +1 @@ -angular.module("irontec.simpleChat").run(["$templateCache", function($templateCache) {$templateCache.put("chatTemplate.html","
\r\n
\r\n
\r\n
\r\n
\r\n

{{vm.title}}

\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n myUserId:{{vm.myUserId}}\r\n \r\n

{{message.content}}

\r\n
\r\n {{message.username}} \r\n {{message.date|date:hh:mm:a}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
");}]); \ No newline at end of file +angular.module("irontec.simpleChat").run(["$templateCache", function($templateCache) {$templateCache.put("chatTemplate.html","
\r\n
\r\n
\r\n
\r\n
\r\n

{{vm.title}}

\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n myUserId:{{vm.myUserId}}\r\n \r\n

{{message.content}}

\r\n
\r\n {{message.username}} \r\n {{message.date|date:hh:mm:a}}\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
");}]); \ No newline at end of file