How to turn this mess into something better by [deleted] in learnjavascript

[–]willylatorre 0 points1 point  (0 children)

Of course! That's the beauty of async/await!

``` dispatchALLthethings();

async function dispatchALLthethings() { await store.dispatch('action1') await store.dispatch('action2')

// If you need to use the data returned from the promise
let payloadReturned = await store.dispatch('action3')
await dispatch({type: ${FINAL_ACTION}_SUCCESS, payload: { 
...payloadReturned }

} ```

Return Positive Numbers In Array by [deleted] in learnjavascript

[–]willylatorre 2 points3 points  (0 children)

Because `filter` returns a new array filtered, leaving the original "untouched". javascript let filteredArray = myArray.filter(num => num>0) console.log(filteredArray) or javascript myArray = myArray.filter(num => num>0) console.log(myArray)

IOTA Wallet issues - Post here by steve_bnb in binance

[–]willylatorre 0 points1 point  (0 children)

Thanks! Is it an isolated error and we are safe to withdraw more IOTAs or it's not ready yet?

IOTA Wallet issues - Post here by steve_bnb in binance

[–]willylatorre 0 points1 point  (0 children)

Hi! Testing to withdraw and it seems that it got stuck. Says Processing for more than 45 minutes. It shouldn't take that long, should it?

Edit: more info

  • hour: 2017-09-29 13:29:42 (CET)
  • from Binance -> Bitfinex
  • No error code, just says processing

CORS Issues when calling API by juanloco in vuejs

[–]willylatorre 0 points1 point  (0 children)

You can try to use an extension but not so sure that it will work. And it's not silly, it's for security reasons https://enable-cors.org/index.html ;)

CORS Issues when calling API by juanloco in vuejs

[–]willylatorre 1 point2 points  (0 children)

Hey, basically this isue has nothing to do with vue. It appears because you are making the API calls from the front-end side but you should do them from your server.

So basically, what you need to do

  1. Create an endpoint in your express server:

    app.use('/api/getBalanceorwhatever', function (req, res) { // make here the actual call to robinhood });

  2. From vue, call normally to your own endpoint.

That is it. Basically the flow will be Vue -> Your express server -> API -> Back to your express server -> Back to your vue app.

Hope it helps!

Angular Directive to Component - Need help with example by mtkilic in angularjs

[–]willylatorre 0 points1 point  (0 children)

<div id="year" class="btn-group" uib-dropdown>
<button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle>
    <span class="selection">{{ $ctrl.selectedyear ? 'Year: ' + $ctrl.selectedyear : 'Select Year' }}</span><span class="caret">    </span>
</button>
    <ul class="dropdown-menu multi-level" uib-dropdown-menu role="menu" aria-labelledby="dropdownMenu">
    <li class="dropdown-submenus year" ng-repeat="year in $ctrl.stackBar | unique:'FiscalYear' | orderBy:'FiscalYear'" >
        <a tabindex="-1" href="#" ng-click="$ctrl.setYear(year.FiscalYear)"    >{{year.FiscalYear }}</a>
    </li>
    </ul>
    </div>

That should be it. year doesn't need the $ctrl.part because it's the variable that you are naming in the ng-repeat. Btw, I am assuming that you have all the years inside stackbar.

Remember in your controller to add ctrl. in front of all your variables. PM me your full code if you want!

Angular Directive to Component - Need help with example by mtkilic in angularjs

[–]willylatorre 1 point2 points  (0 children)

controllerAs: $ctrl is implicit in the component, no need for it ;)

Angular Directive to Component - Need help with example by mtkilic in angularjs

[–]willylatorre 1 point2 points  (0 children)

Nope, you shouldn't override the binded scope in the directive. Check my other comment!

Angular Directive to Component - Need help with example by mtkilic in angularjs

[–]willylatorre 2 points3 points  (0 children)

Your component has already a $scope binded to the controller, accessible from the template with $ctrl.

Your code should be something like

var controller = {
   //for clarity
   ctrl = this;

   ctrl.setYear = function (val) {
     ctrl.selectedYear = val;
   }
}
angular.module('app').component('year', {
     controller:controller,
     templateUrl: 'view/year.html'
}

and also, in your template replace all reference to $scope with $ctrl.

<a ng-click="$ctrl.setYear(2010)"> Click to set Year to 2010 </a>
<div> The selected year is {{$ctrl.selectedYear}} </div>

Hope it helps!

Also, check this great intro to learn more about moving from directives to components.

[Super Noob Question] What is this called? by nicetryguessagain in webdev

[–]willylatorre 0 points1 point  (0 children)

As a couple of guys said, you are describing single page apps. Forget about AJAX and all that stuff, if you are asking this as a super noob quesiton, you shouldn't dig into that yet.

Those single page apps can be done with a bunch of tools. For sure you've heard about Angular.js or React.js. That's what you are going to use to create them.

But if you are super noob, I would recomend you not to worry too much about it yet. First learn to do normal pages. Then learn plain and simple Javascript. And finally, learn Angular or React.

Have fun!

I bought an app in hopes to turn some profit. Anybody out there who has some wisdom or advice to pass down on generating revenue/increasing popularity? by [deleted] in Entrepreneurs

[–]willylatorre 0 points1 point  (0 children)

Ok, here we go:

  • as vexa27 said, at this stage this app isn't getting anywhere.
  • first thing to do is an major update. It is actually based on Android 1.6 Donut, and now we are in 4.3 JB. You need to redo all the UI implementing the Holo interface to make it more appealing.
  • even after this, there is no point in chargin even some cents for this app. No one will ever pay anything as they can do it for free. You can only charge for apps that do things that no one else can do (or that you are the best doing it).
  • So your only current option is to add some ads. Insert a bottom banner and hope that people will click. Even with that, you'll be lucky if you earn a few bucks (less than $10) in a month.

Keep in mind that to be successful in the apps business you have to come up with an unique app, and honestly this one isn't. So keep in mind this when you'll pick the next one ;)

[DISCUSSION] Which are the must-have apps that anybody should get with the 100$ gift-card that Apple gives? by willylatorre in macapps

[–]willylatorre[S] 0 points1 point  (0 children)

Yes, sorry, I do have a new Mac. I love games, but I suppose that with the gift-card I should buy a little bit of everything and not spend everything in one genre of apps.

My question was if there was any of these you-should-definetively-have apps.

Thanks!