Jump to content

Need some help with Firebase. Its all in Node.js and HTML.

upliftsleet1974
Go to solution Solved by neystro,

Nope still broken. 

This is the page I am using it on fyi: https://deltadoor.herokuapp.com/products.html

from what I can see in your source code from your website:

 

line 138 of products.html: change for <div ng-repeat="product in products" class="col-md-3 col-sm-6 highlight"> 

line 230 of products.html : I get a 404(not found) <script src="js/app.js"></script> will work 

 

you can give me your github repo if you want to.

Okay I am trying to use firebase to host the json data for an items listing. And I can not get it to work with my app so this is the code were it is being inserted 

 

<div class="row">

<div ng-repeat="product in product" class="col-md-3 col-sm-6 highlight">

<div class="shop-item">  
<div class="shop-item-image">
<a href="page-product-details.html"><img src="{{.img}}"></a>
</div>
<div class="title">
<h3><a href="page-product-details.html">{{product.item}}</a></h3>
</div>
<div class="price">
 {{product.price}}
</div>
<div class="actions">
</div>
</div>
</div>
 
I have all the controllers and head tags set up right and am loading the firebase app form an app.js file and all that seems to be working. So what am I missing? 
 
Also I have used this before on one of my other sites and it works great no idea why it will not work now. Any help would be great.
 
Thank you for your time :D
 
Edit: Link to the Firebase guide I used https://www.firebase.com/docs/web/libraries/angular/guide.html
 
Edit 2: This is the working code from another project.
 
<div class="row">
<div ng-repeat="about in abouts" class="col-md-3 col-sm-6 highlight">
<div class="h-caption"><h4><i class="fa fa-{{about.icon}}"></i>{{about.area}}</h4></div>
<div class="h-body text-center">
<p>{{about.description}}</p>
</div>
</div>

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

 ng-repeat="product in product" 

 

 

 

is it normal that both have the same name? can it work?

Link to comment
Share on other sites

Link to post
Share on other sites

 

is it normal that both have the same name? can it work?

 

I am not exactly sure. I am going to update the first post with a set of the working code form the other project.

 

Edit: First post updated.

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

well, in your second exemple, ng-repeat="about in abouts" , maybe that's a part of your problem.

 

also,  <img src="{{.img}}"></a>  did you forgot something? like product.img ?

 

it's kinda hard to help you without your javascript!

Link to comment
Share on other sites

Link to post
Share on other sites

well, in your second exemple, ng-repeat="about in abouts" , maybe that's a part of your problem.

 

also,  <img src="{{.img}}"></a>  did you forgot something? like product.img ?

 

it's kinda hard to help you without your javascript!

okay. I know the img is messed up just did not fix it :)

 

This is the app.js file and I can show you any others that may help. (I know its hard to help people without a lot of info. but I am not sure what info to give haha)

 
var app = angular.module("dealt1App", ["firebase"]);
 
app.controller("Dealt1Ctrl", function($scope, $firebase) {
  var ref = new Firebase("https://dealt1.firebaseio.com/product");
  var sync = $firebase(ref);
  // download the data into a local object
  var syncObject = sync.$asObject();
  // synchronize the object with a three-way data binding
  // click on `index.html` above to see it used in the DOM!
  syncObject.$bindTo($scope, "product");
});
 

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

I could show the github project if that would really help.

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

Do you know how Angular work or you are guessing?

 

abouts is the name of the variable that you need to use in your html since you are binding to it syncObject.$bindTo($scope, "abouts");

 

try to change the ng-repeat="product in product" to ng-repeat="product in abouts"

Link to comment
Share on other sites

Link to post
Share on other sites

Do you know how Angular work or you are guessing?

 

abouts is the name of the variable that you need to use in your html since you are binding to it syncObject.$bindTo($scope, "abouts");

 

try to change the ng-repeat="product in product" to ng-repeat="product in abouts"

I posted the code form the working project....I did not mean to :( I updated that last post so now it is product.

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

I posted the code form the working project....I did not mean to :( I updated that last post so now it is product.

ahh make more sense, you should try to put  syncObject.$bindTo($scope, "products"); because 2 variable with the same name will probably not work. 

Link to comment
Share on other sites

Link to post
Share on other sites

ahh make more sense, you should try to put  syncObject.$bindTo($scope, "products"); because 2 variable with the same name will probably not work. 

Nope still broken. 

This is the page I am using it on fyi: https://deltadoor.herokuapp.com/products.html

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

Nope still broken. 

This is the page I am using it on fyi: https://deltadoor.herokuapp.com/products.html

from what I can see in your source code from your website:

 

line 138 of products.html: change for <div ng-repeat="product in products" class="col-md-3 col-sm-6 highlight"> 

line 230 of products.html : I get a 404(not found) <script src="js/app.js"></script> will work 

 

you can give me your github repo if you want to.

Link to comment
Share on other sites

Link to post
Share on other sites

from what I can see in your source code from your website:

 

line 138 of products.html: change for <div ng-repeat="product in products" class="col-md-3 col-sm-6 highlight"> 

line 230 of products.html : I get a 404(not found) <script src="js/app.js"></script> will work 

 

you can give me your github repo if you want to.

Wow that did it :) Thank you so so so much!!

 

Edit: did not push the update out so the public site will still not work (Just in case you went to look at it haha)

CPU Ryzen 5 Asrock B350 Pro 4 / MSI RX580 Gaming / RAM 16 Gigs Corsair Vengeance 3000 / HDD 1TB Seagate Barracuda / SSD Samsung 840 120GB / 500GB Samsung SSD / Case Urban S31 / PSU EVGA G2 750w / Os Windows 10 / Keyboard Corsair K70 / Mouse Razer Naga 2013 (Won it from Linus!!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×