DEV Community

Faisal Ahmed
Faisal Ahmed

Posted on • Edited on

Commenting on Angular Project

// Font Awesome Icon
Enter fullscreen mode Exit fullscreen mode
// Store Data
Enter fullscreen mode Exit fullscreen mode
// Static Data
Enter fullscreen mode Exit fullscreen mode
// Loader Data
isLoaded: boolean = false; 
Enter fullscreen mode Exit fullscreen mode
// Subscriptions
  private subGetData1!: Subscription;
Enter fullscreen mode Exit fullscreen mode
// Inject
Enter fullscreen mode Exit fullscreen mode
  private readonly reloadService = inject(ReloadService);
Enter fullscreen mode Exit fullscreen mode
  ngOnInit(): void {
    // GET DATA FROM PARAM
    this.activatedRoute.paramMap.subscribe(param => {
      this.id = param.get('id');
      if (this.id) {
        this.getOrderById();
      }
    })

    // Base Data
    this.getData1();
  }
Enter fullscreen mode Exit fullscreen mode
  /**
   * HTTP REQUEST HANDLE
   * getAllCategories()
   */
Enter fullscreen mode Exit fullscreen mode
  /**
   * On Destroy
   */
Enter fullscreen mode Exit fullscreen mode
 ngOnDestroy() {
    if (this.subGetData1) {
      this.subGetData1.unsubscribe();
    }
  }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay