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

317
Views
¿Cómo evitar que un componente se inicie/renderice cuando los parámetros requeridos no se completen correctamente?

Digamos que tengo un componente y tengo enlaces que no son opcionales, así

 angular.module("foo").component("fooComp", { bindings: { notOpt: "<", }, templateUrl: "...", controllerAs: "...", controller: [fooCtrl], }); function fooCtrl() { const $vm = this; $vm.$onInit = onInit; function onInit() { // ... } }

¿Hay alguna manera de evitar que el componente se represente sin la ayuda de una bandera y ngIf? ¿Algo así como una autodestrucción?

Gracias

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Lo que terminé haciendo fue simplemente eliminar el elemento con $element.remove() y luego destruir el alcance con $scope.destroy() .

about 4 years ago · Juan Pablo Isaza Report

0

Prueba "Renderizado condicional" :D Te dejo el sitio que te dice cómo hacerlo. React y Angular son JavaScript. Puedes hacer lo que necesites con esta idea :D

https://www.digitalocean.com/community/tutorials/7-ways-to-implement-conditional-rendering-in-react-applications

Si mi respuesta te ayudó, por favor selecciona mi respuesta :D

about 4 years ago · Juan Pablo Isaza Report
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!