A Pen by Alessandro Falchi on CodePen.
Created
April 24, 2016 16:42
-
-
Save afalchi82/0505b4d3e87c1c60cf8aeddca3225c5b to your computer and use it in GitHub Desktop.
Guide Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul | |
li | |
| hello | |
ul | |
li Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus tenetur repellat, corporis deserunt facilis quos. Quis, quam adipisci nemo possimus placeat ipsum recusandae cupiditate, alias, aliquam ipsa ducimus velit tenetur! | |
ul | |
li hello 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp', ['firebase']) | |
.run(function($rootScope, chatMessages) { | |
var vm = $rootScope; | |
vm.text = 'Gianni'; | |
vm.chatMessages = chatMessages; | |
vm.submit = function () { | |
vm.chatMessages.$add({ | |
text: vm.text | |
}); | |
vm.text = ''; | |
}; | |
}) | |
// this factory returns a synchronized array of chat messages | |
.factory("chatMessages", function($firebaseArray) { | |
// create a reference to the database location where we will store our data | |
//var randomRoomId = Math.round(Math.random() * 100000000); | |
var ref = new Firebase("https://m1sc.firebaseio.com/chat/"); | |
// this uses AngularFire to create the synchronized array | |
return $firebaseArray(ref); | |
} | |
) | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> | |
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> | |
<script src="https://code.angularjs.org/1.3.15/angular.min.js"></script> | |
<script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script> | |
<script src="https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul { | |
margin: 0 0 0 10px; padding: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment