Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Gersho
@Gersho
it is a cash register, not a bank account ;)
CamperBot
@camperbot
:cookie: 535 | @gersho |http://www.freecodecamp.com/gersho
Ian Gracia
@iangracia
Yeah, my fault in logic :)
the whole challenge got ALOT harder all of a sudden :laughing:
Matej Bošnjak
@mbosnjak01
Hi. @mbosnjak01
Hi. Just a quick question about ng-repeat in Amgular JS, if anyone could answer me here (angularjs room isn't much active). Is it possible to repeat items from multiple scopes? (an array of scopes with indentical properties) ... for example <div ng-repeat ="item in arrayOfScopes"></div> ? - where array of scopes would be something like this: arrayOfScopes = [$scopeOne, $scopeTwo ... ] ? Is something like this possible?
I really don't want to have separate div element for each scope
Lean Junio
@leanjunio
@mbosnjak01 Can’t you make an object that has access to different properties?
…
$scope.object = {}


// later use

$scope.object.propertyOne;
$scope.object.propertyTwo;

instead of multiple scopes?
Matej Bošnjak
@mbosnjak01
@leanjunio How would I implement that in a single div element?
I mean, is it possible ...
Lean Junio
@leanjunio
@mbosnjak01 I see what you mean now
@mbosnjak01 well, give it a try, create 2 arrays within a scope object, and then ng-repeat them both using 2 divs
Matej Bošnjak
@mbosnjak01
Using 2 divs will work
But I was thinking of repeating both of them in a single div
Lean Junio
@leanjunio
oh, i see
what does ur html look like?
and what are you trying to feed into it?
Matej Bošnjak
@mbosnjak01
users ... I have 2 api calls, first call get's 10 users in a scope, and second 5 users ... but my scope doesn't work properly when I do 2 calls on one scope ... so I was thinking of dinamically creating a scope (with indentical properties) on a single div, so I don't need to create multiple divs via html or js.
creating a scope for each api call
so if I could do something like ng-repeat="scope1 |scope2" would be great XD
if not, i'll have to go and create div for each scope :(
Lean Junio
@leanjunio
lol, doesn’t seem like that’s allowed https://docs.angularjs.org/api/ng/directive/ngRepeat
Do you have your code on Github?
Niloy513
@Niloy513
can someone be able to give me some pointers on handling api with angularjs?
I don't know why it isn't working, help would be appreciated
Lean Junio
@leanjunio
what’s the endpoint you’re trying to hit?
piteto
@piteto

you'll need to use HTTPS (and probably JSONP after that) for that API @Niloy513

angular.min.js:sourcemap:103 Mixed Content: The page at 'https://s.codepen.io/Niloy513/pen/VMQNmd?editors=1011' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en'. This request has been blocked; the content must be served over HTTPS.

Lean Junio
@leanjunio
Also, your method, should be : ‘GET'
Niloy513
@Niloy513
make a random quote appear using the variable $scope.quote I see I was confused about method because they say the method should be getQuote so it's odd. and piteto I'll try out what you advice.
@leanjunio thank you
@piteto Thank you
CamperBot
@camperbot
niloy513 sends brownie points to @leanjunio and @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 228 | @piteto |http://www.freecodecamp.com/piteto
:cookie: 288 | @leanjunio |http://www.freecodecamp.com/leanjunio
Lean Junio
@leanjunio
@Niloy513 what’s the url for the quote api?
Niloy513
@Niloy513
how were you able to tell I needed https though
Moisés Man
@moigithub
This request has been blocked; the content must be served over HTTPS.
Niloy513
@Niloy513
I can't explain it well but that can, the url they have posted on the site doesn't work for some reason
piteto
@piteto
niloy, it's a good idea to read about mixed-content. http is not secure, https is. When your web page is loaded over https everything else needs to use https too
(otherwise it's not secure)
Niloy513
@Niloy513
I am not good with api yet unfortunately. may I ask how you were able to find the bug issues so quickly? I have my debugger on codepen.
Lean Junio
@leanjunio
@Niloy513 Have you had any experience reading about AJAX for JavaScript and how requests and responses work?
Dan Schapira
@dsschapira
@Niloy513 That's a pretty common bug for people to get when they first start out with APIs - I know that's how I knew about it... @piteto just got to their answer first :)
piteto
@piteto
@Niloy513 I used the browser's debugger instead of the one in codepen. The one in codepen only reports what you log with console.log. The one in the browser is for debugging errors.
I don't know angular well, or if this is the right way to do it, but this will get your quote logged to the console:
var app = angular.module("model", []);

app.controller("control", [
  "$scope", "$http", function($scope, $http) {
    $scope.newquote = () => {
      $http.jsonp("https://api.forismatic.com/api/1.0/?method=getQuote&format=jsonp&lang=en&jsonp=showQuote")
    };
  }
]);

function showQuote(data) {
  console.log(data);
}
Niloy513
@Niloy513
I have but they don't make much sense if you have a link for a clear info of them I would love that. Thanks for the info and help as well guys.
@piteto I don't whether to be envious or jealous of you. I've been working on this for two days and you managed to get it in 10 minutes. Thank you very much for your wisdom.
CamperBot
@camperbot
niloy513 sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
api offline
Dan Schapira
@dsschapira
I totally read the wrong part of this chat when I jumped in... ignore my last reply lol
Lean Junio
@leanjunio

@Niloy513 Totally man, here’s two links to AJAX requests (Basically what you’re trying to make earlier, you were trying to make a GET request to the quote person’s server), this is a great channel for all other stuff btw.

https://www.youtube.com/watch?v=h0ZUpPiV1ac&t=2s

and here’s the FCC vid for AJAX: https://www.youtube.com/watch?v=tHRNuBf_8xg

@Niloy513 Another nice on it seems, https://www.youtube.com/watch?v=ecT42O6I_WI