@brggroup/share-lib 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -761,6 +761,9 @@ class BaseComponent {
761
761
  translate = inject(TranslateService);
762
762
  modal = inject(CustomModalService);
763
763
  routeSub;
764
+ /**
765
+ * Khi dùng onRouteChange nhớ dùng unSubRouteChange
766
+ */
764
767
  onRouteChange(callback) {
765
768
  this.routeSub = this.router.events
766
769
  .pipe(filter((e) => e instanceof NavigationEnd))
@@ -784,6 +787,9 @@ class BaseComponent {
784
787
  }
785
788
  }
786
789
  }
790
+ /**
791
+ * /:id
792
+ */
787
793
  getUrlParam(paramName) {
788
794
  const paramValue = this.route.snapshot.params[paramName];
789
795
  // bằng 0 thì trả về null vì chuyển primary key từ bigint sang string, code cũ đang truyền vào 0
@@ -792,10 +798,16 @@ class BaseComponent {
792
798
  }
793
799
  return paramValue;
794
800
  }
801
+ /**
802
+ * ?id=xxx
803
+ */
795
804
  getUrlQueryParam(queryParamName) {
796
805
  const queryParamValue = this.route.snapshot.queryParamMap.get(queryParamName);
797
806
  return queryParamValue;
798
807
  }
808
+ /**
809
+ * Routes data
810
+ */
799
811
  getUrlData(key) {
800
812
  return this.route.snapshot.data[key];
801
813
  }
@@ -969,9 +981,17 @@ class BaseOverlayComponent extends BaseComponent {
969
981
 
970
982
  class Breadcrumb extends BaseComponent {
971
983
  Breadcrumb = Breadcrumb;
972
- static lstBreadcrumb = [];
984
+ static _lstBreadcrumb = [];
985
+ static get lstBreadcrumb() {
986
+ return Breadcrumb._lstBreadcrumb;
987
+ }
988
+ set lstBreadcrumb(val) {
989
+ setTimeout(() => {
990
+ Breadcrumb._lstBreadcrumb = val;
991
+ }, 0);
992
+ }
973
993
  static clear() {
974
- Breadcrumb.lstBreadcrumb = [];
994
+ Breadcrumb._lstBreadcrumb = [];
975
995
  }
976
996
  gohome() {
977
997
  this.goto('');