angular one way property binding
/* One Way Data Binding
- One way data-binding
- binds data from the component to the view or vice versa and is unidirectional
- From Component to View
- Interpolation Binding:
- interpolation refers to binding expressions into marked up language
- Examples:
- .ts `firstName: string = 'theCodingStoic'`
- .html: `{{ firstName }}`
- Property Binding:
- sets the property of a view element. The binding sets the property to the value of a template expression
- Examples:
- .ts `firstName: string = 'theCodingStoic'`
- .html: `<span [innerHTML]='firstName'></span>`
- Attribute Binding:
- sets the attribute property of a view element
- Examples:
- Class Binding:
- sets the class property of a view element
- Examples:
- Style Binding:
- sets the style of a view element
- Examples:
- .html: `<h1 [style.color]='blue'>This is a blue heading</h1>`
- From View to Component
- This can be acheived by using the event binding technique
- Examples:
- .ts:
```javascript
export class AppComponent{
myFunction():void {
alert('Show Alert');
}
}
```
- .html: `<button (click)="myFunction()">Show Alert</button>`
- What happens here is that when someone clicks on the button the view will send that information to the component and the component will run the function associated with the click event
*/
Also in JavaScript:
- how to use dotenv in javascript
- what is code.jquery integrity crossorigin
- node js to check 32 bit
- how to use the match function in javascript for regex
- js remove if
- how to add onclick event in javascript
- nodemailer
- how to get file extension in javascript last index
- react render for loop
- set up background process in express app
- use jsx html
- dracula theme color scheme windows terminal app
- swap scroll right in react native
- array unique values javascript
- javascript change page title
- js clone array
- atob nodejs
- libuv nodejs
- generate an array of random numbers javascript
- join three array javascript
- Expected an assignment or function call and instead saw an expression
- navlink activestyle not working
- javascript math absolute
- checking object is empty in JS