Skip to content

Commit

Permalink
Merge pull request #96 from karnavpargi/patch-1
Browse files Browse the repository at this point in the history
Added angular v18 service import example
sudheerj authored Jan 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 9a21af1 + 514d492 commit 79e7e22
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -594,6 +594,22 @@
console.log(myService); // MyService
}
}
// Angular v18 and above
import { Component, inject } from '@angular/core';
import { MyService } from './my-service';
@Component({
selector: 'my-component',
template: '<div>Parameter decorator</div>'
})
export class MyComponent {
myService: MyService = inject(MyService)
constructor() {
console.log(myService); // MyService
}
}
```
**[⬆ Back to Top](#table-of-contents)**

0 comments on commit 79e7e22

Please sign in to comment.