mesauth-angular 0.1.4 → 0.1.5

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.
package/README.md CHANGED
@@ -160,6 +160,7 @@ A reusable Angular component for displaying the current user's profile informati
160
160
  If you encounter an error like "The injectable 'MesAuthService' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available," this typically occurs because:
161
161
  - The package is being imported directly from source code (e.g., during development) without building it first.
162
162
  - The client app is running in AOT (Ahead-of-Time) compilation mode, which requires pre-compiled libraries.
163
+ - **Why JIT is required:** Originally, `MesAuthService` used `@Injectable({ providedIn: 'root' })`, making it a library-provided service. Angular libraries must be built with tools like ng-packagr to generate AOT-compatible code. If not, or if imported from source, the service requires JIT compilation in the client's app. This change (removing `providedIn: 'root'` and requiring manual provision) allows the service to be compiled in your app's context, supporting both JIT and AOT modes.
163
164
 
164
165
  **Solutions:**
165
166
  1. **Build the package for production/AOT compatibility:**
@@ -5,7 +5,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Component } from '@angular/core';
8
- import { CommonModule } from '@angular/common';
9
8
  import { ToastContainerComponent } from './toast-container.component';
10
9
  import { UserProfileComponent } from './user-profile.component';
11
10
  import { NotificationPanelComponent } from './notification-panel.component';
@@ -15,7 +14,7 @@ MaUserComponent = __decorate([
15
14
  Component({
16
15
  selector: 'ma-user',
17
16
  standalone: true,
18
- imports: [CommonModule, ToastContainerComponent, UserProfileComponent, NotificationPanelComponent],
17
+ imports: [ToastContainerComponent, UserProfileComponent, NotificationPanelComponent],
19
18
  template: `
20
19
  <ma-toast-container></ma-toast-container>
21
20
  <div class="user-header">
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Component, Output, EventEmitter } from '@angular/core';
11
- import { CommonModule } from '@angular/common';
11
+ import { NgIf } from '@angular/common';
12
12
  import { MesAuthService } from './mes-auth.service';
13
13
  import { Subject } from 'rxjs';
14
14
  import { takeUntil } from 'rxjs/operators';
@@ -52,7 +52,7 @@ NotificationBadgeComponent = __decorate([
52
52
  Component({
53
53
  selector: 'ma-notification-badge',
54
54
  standalone: true,
55
- imports: [CommonModule],
55
+ imports: [NgIf],
56
56
  template: `
57
57
  <button class="notification-btn" (click)="onNotificationClick()" title="Notifications">
58
58
  <span class="icon">🔔</span>
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
10
  import { Component, Output, EventEmitter } from '@angular/core';
11
- import { CommonModule } from '@angular/common';
11
+ import { NgIf } from '@angular/common';
12
12
  import { Router } from '@angular/router';
13
13
  import { MesAuthService } from './mes-auth.service';
14
14
  import { Subject } from 'rxjs';
@@ -110,7 +110,7 @@ UserProfileComponent = __decorate([
110
110
  Component({
111
111
  selector: 'ma-user-profile',
112
112
  standalone: true,
113
- imports: [CommonModule],
113
+ imports: [NgIf],
114
114
  template: `
115
115
  <div class="user-profile-container">
116
116
  <!-- Not logged in -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mesauth-angular",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Angular-friendly SignalR notifier + API helper for current user and notifications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",