D
D
Dima Pautov2016-11-28 11:40:55
Ember.js
Dima Pautov, 2016-11-28 11:40:55

Is there any lesson or article where working with firebase for ember js is described in as much detail as possible?

Watched this tutorial Installed emberfire
, added it to the environment.js file

contentSecurityPolicy: {
      'connect-src': "'self' wss://*.firebaseio.com https://*googleapis.com"
    },
    firebase: {
      apiKey: "AIzaSyB0NegzN8bpiwZQG9Hk1NXHpBTADV9XfqA",
      authDomain: "nodecms-c87f6.firebaseapp.com",
      databaseURL: "https://nodecms-c87f6.firebaseio.com",
      storageBucket: "nodecms-c87f6.appspot.com",
      messagingSenderId: "279451456587"
    },

Created a controller: \app\controllers\pages\add.js
addPage: function(){

      var self = this;

      var title = self.get('title');
      var description = self.get('description');

      var 
        menuLeft = self.get('menuLeft'),
        menuRight = self.get('menuRight'),
        menuTop = self.get('menuTop'),
        menuBottom = self.get('menuBottom');

      var pageNotActive = self.get('pageNotActive');

      var newPage = self.store.createRecord('page-item.add', {
        title,
        description,
        menuLeft,
        menuRight,
        menuTop,
        menuBottom,
        pageNotActive
      });

      newPage.save();
    }

Created a model: \app\models\pages\add.js
export default DS.Model.extend({
  title: DS.attr('string'),
  description: DS.attr('string'),
  menuLeft: DS.attr('boolean'),
  menuRight: DS.attr('boolean'),
  menuTop: DS.attr('boolean'),
  menuBottom: DS.attr('boolean'),
  pageNotActive: DS.attr('boolean'),
});

But in the end I get this:
08231570c9434e19aedb23cf0fe46f94.JPG
How to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Titov, 2017-02-21
@titov_andrei

According to your screenshot with an error - maybe you need to register rights on firebase?
According to the lessons from the last thing that came across - yoember.com - there is a lot more.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question