Ionic Angular Firebase pass value problem


Hi I’m new on Ionic, and I have been a couple of days with this problem.
I create an app from chat examples, and I want to connect and read to my firebase database.
The first part is woking.- I can retreive and show data from firebase, but my problem is when I click on the “Item list” and want to show full description, I don not understand how to pass value and get the data again.

Here are my scripst:
app.js ( I’m only showing part of them )

    angular.module('starter', ['ionic', 'starter.controllers', '','firebase'])

.run(function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)
    if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) {
    if (window.StatusBar) {
      // org.apache.cordova.statusbar required

.config(function($stateProvider, $urlRouterProvider) {

  // Ionic uses AngularUI Router which uses the concept of states
  // Learn more here:
  // Set up the various states which the app can be in.
  // Each state's controller can be found in controllers.js

  // setup an abstract state for the tabs directive
    .state('tab', {
    url: "/tab",
    abstract: true,
    templateUrl: "templates/tabs.html"

  // Each tab has its own nav history stack:

  .state('tab.dash', {
    url: '/dash',
    views: {
      'tab-dash': {
        templateUrl: 'templates/tab-dash.html',
        controller: 'DashCtrl'

  .state('tab.chats', {
      url: '/chats',
      views: {
        'tab-chats': {
          templateUrl: 'templates/tab-chats.html',
          controller: 'ChatsCtrl'
    .state('', {
      url: '/chats/:chatId',
      views: {
        'tab-chats': {
          templateUrl: 'templates/chat-detail.html',
          controller: 'ChatDetailCtrl'

  .state('tab.account', {
    url: '/account',
    views: {
      'tab-account': {
        templateUrl: 'templates/tab-account.html',
        controller: 'AccountCtrl'

  // if none of the above states are matched, use this as the fallback


Here is my services file — services.js

    angular.module('', [])

.factory('fireBaseData', function($firebase) {
  // Might use a resource here that returns a JSON array
	var ref = new Firebase("")
	refCorales = new Firebase("");
 var fireBaseData = {
	all: refCorales,    
		get: function (chatId) {
		return $firebase(ref.child('refCorales').child(chatId)).$asObject();
  return {
        ref: function() {
            return ref;
         refCorales: function() {
            return refCorales;

And the controller file – controller.js

    angular.module('starter.controllers', [])

.controller('DashCtrl', function($scope) {})

.controller('ChatsCtrl', function($scope, $firebase, fireBaseData) {
     $scope.corales  = $firebase(refCorales);

.controller('ChatDetailCtrl', function($scope, $stateParams, fireBaseData) {
  $scope.corales = refCorales.get($$id);

.controller('AccountCtrl', function($scope) {
  $scope.settings = {
    enableFriends: true

Any idea will be we received , thank you,



So what does a single object look like? At first glance, this could be the problem, $$id

It should be $stateParams.chatId like you have defined in your states and services.


Hi : Mike :

Thank you for your response, and you’re right, the problem was that, I was using: $$id instead of $stateParams.chatid, and Also I found an error the “get” function, I aready fixed and the app it’s running Ok.
It retrive the data from Firebase !




Hi caribesoft, could you share the solution for the get ?