This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable() | |
export class DataService { | |
// here the name is getData | |
getData() {} | |
} | |
@Injectable() | |
export class SomeDataService { | |
// here the name is getSomeOtherData | |
getSomeOtherData() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
template: ` | |
<h2>User List:</h2> | |
<table> | |
<thead> | |
<tr> | |
<th>Username</th> | |
<th>Email</th> | |
<th>Last Login</th> | |
<th>Role</th> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// instead of this | |
@Component({ | |
template: ` | |
@switch (country.value()) { | |
@case ('UK') { | |
<app-uk-payroll/> | |
} | |
@case ('USA') { | |
<app-usa-payroll/> | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
template: ` | |
<div> | |
<label for="continent">Continent:</label> | |
<select id="continent" [(ngModel)]="selectedContinent"> | |
@for(continent of continents; track continent) { | |
<option [value]="continent">{{ continent }}</option> | |
} | |
</select> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
async function findMissingImports(projectRoot, directiveName, directiveClass) { | |
const missingImportFiles = []; | |
const searchDirectory = async (dir) => { | |
const files = fs.readdirSync(dir); | |
for (const file of files) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "src/scss/redesign/base/variables.scss"; | |
@import "src/scss/redesign/base/mixins.scss"; | |
:host { | |
.employee-grid-view { | |
.row { | |
margin-left: -6px !important; | |
margin-right: -6px !important; | |
[class*='col-sm'] { | |
padding-left: 6px !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
async function findMissingImports(projectRoot, directiveName, directiveClass) { | |
const missingImportFiles = []; | |
const searchDirectory = async (dir) => { | |
const files = fs.readdirSync(dir); | |
for (const file of files) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"dependencies": { | |
"@angular/animations": "^17.3.11", | |
"@angular/cdk": "^16.2.14", | |
"@angular/common": "^17.3.11", | |
"@angular/compiler": "^17.3.11", | |
"@angular/core": "^17.3.11", | |
"@angular/forms": "^17.3.11", | |
"@angular/localize": "^17.3.11", | |
"@angular/material": "^16.2.0", | |
"@angular/platform-browser": "^17.3.11", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
template: ` | |
<form #form="ngForm" (ngSubmit)="submit(form)"> | |
<input type="text" name="name" | |
[(ngModel)]="controls.name" placeholder="Name" /> | |
<input type="email" name="email" | |
[(ngModel)]="controls.email" placeholder="Email" /> | |
<div ngModelGroup="address"> | |
<input type="text" name="street" | |
[(ngModel)]="controls.address.street" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Injectable({ providedIn: 'root' }) | |
export class TodosStore { | |
readonly #todosService = inject(TodosService); | |
query = signal(''); | |
#todos = rxResource({ | |
request: () => ({ query: this.query() }), | |
loader: ({ request }) => | |
this.#todosService.getTodos(request.query), | |
}); | |
// expose only a readonly value of the resource |