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)