Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
Problema asincrónico de angularjs. cómo cargar datos de otro componente

Tengo que usar "establecer tiempo de espera" para obtener los datos del componente principal, de modo que pueda cargarlos en la página antes de que

Deseo reemplazar esto con una función de promesa o asíncrona. Pero parece que no puedo obtener la sintaxis correcta.

Aquí está el código:

 angular. module('fwcForms'). component('tableFreetext', { templateUrl: _formPath+'/fwc-form/components/table-freetext.template.html', bindings: { model: '=', }, controller: function TableFreetextController() { var self = this; this.$onInit = function() { setTimeout(()=>{ self.newValue = self.model.dataRowsPlaceholder; },1000); } } });

Deseo reemplazar:

 setTimeout(()=>{ self.newValue = self.model.dataRowsPlaceholder; },1000);

con algo como

 let myPromise = new Promise(function() { return self.model.dataRowsPlaceholder }); myPromise.then(data=>{ self.newValue = self.model.dataRowsPlaceholder });

Pero esto no funciona. Sigue diciendo que "self.model.dataRowsPlaceholder" es 'indefinido'.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!