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
observables are lazy, means that if it doesnt have a subscribe, observables cant execute the code. | |
Subject are other type of observable, they both can emit many values. | |
observables can't emit data outside itself. | |
subjects can emit multiples values outside itself. | |
example: https://stackblitz.com/edit/angular-ivy-5tnmap |
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
@media(hover: hover) { | |
::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical) { | |
background-color: red !important; | |
border-radius: 0 !important; | |
} | |
::ng-deep .mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical) { | |
background-color: green !important; | |
border: 0 !important; | |
border-radius: 0 !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
Signals are a value that can be observed, I can call a method in the last item of an array, example. as rxjs, they can work like "follow" updates in variables, objects etc. | |
.set: set a new value for a variable and notify dependents. | |
.update: update a value based with a current value (number ) => number + 1 and return the new value | |
.mutate: catch the new value and updated it. its similar with update, the diference is .mutate doesn't return a value and mentains a history. | |
effect and computed: will receive a notify and do something about it | |
effect(() => console.log(we have ${number} dogs now! |
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
function countMinimumOperations(password) { | |
let operations = 0; | |
let vowels = 0; | |
let consonants = 0; | |
// Count the number of vowels and consonants in the password | |
for (let i = 0; i < password.length; i++) { | |
const char = password[i]; | |
if ('aeiou'.includes(char)) { | |
vowels++; |
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
interface Employee { | |
name: string; | |
role: string; | |
} | |
const list: Employee[] = [ | |
{ name: 'andreia', role: 'developer' }, | |
{ name: 'john', role: 'CEO' }, | |
{ name: 'mica', role: 'sales' }, | |
{ name: 'joana', role: 'cleaner' }, |
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
function removeTodo(todoList: Todo[], id: number): Todo[] { | |
throwErrors(todoList, id); | |
let newList = todoList.filter((item: Todo) => { | |
return item.id !== id | |
}) | |
return newList; | |
} | |
function toogleTodo(todoList: Todo[], id: number): Todo[] { |
OlderNewer