This file contains 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
<script> | |
import AppOffer from '../../AppOffer' | |
export default { | |
props: { | |
counter: { | |
type: Number, | |
default: 1 | |
} | |
}, |
This file contains 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
<script> | |
export default { | |
methods: { | |
search() { | |
console.log('Search') | |
}, | |
addOffer(offer) { | |
this.offers.push(offer); | |
} |
This file contains 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
<script> | |
import AppOffer from '../../AppOffer' | |
export default { | |
props: { | |
counter: { | |
type: Number, | |
default: 1 | |
} | |
}, |
This file contains 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
<template lang="html"> | |
<div class="container"> | |
<div class="offers"> | |
<div | |
class="offer" | |
v-for="offer in offers" | |
> | |
<AppOffer :offer="offer"></AppOffer> | |
This file contains 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
npm install -g @angular/cli | |
ng new PROJECT-NAME | |
cd PROJECT-NAME | |
ng serve | |
// configuring default port | |
ng serve --host 0.0.0.0 --port 4201 |
This file contains 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
<template lang="html"> | |
<div class="container"> | |
<div class="offers"> | |
<div | |
class="item" | |
v-for="offer in offers" | |
> | |
<AppOffer :offer="offer"></AppOffer> | |
<div> |
This file contains 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 '../../assets/styles/main.scss'; | |
.offer { | |
position: relative; | |
margin-top: 30px; | |
min-height: 300px; | |
padding: 20px; | |
border: 1px solid palette(red, dark); | |
} |
This file contains 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
<div class="container"> | |
<div class="offers"> | |
<div | |
class="offer" | |
*ngFor="let offer of offers" | |
> | |
<app-offer [offer]="offer"></app-offer> | |
<button (click)="addOffer(offer)"></button> | |
<div> |
This file contains 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
<template lang="html"> | |
<button | |
:class="{active: isActive, disabled: disabled}" | |
:style="buttonStyles" | |
></button> | |
</template> | |
<script> |
This file contains 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 { Component, OnInit } from '@angular/core'; | |
// other imports | |
@Component({ | |
selector: 'app-offer', | |
templateUrl: './offer.component.html', | |
styleUrls: ['./offer.component.scss'] | |
}) | |
export class HeaderComponent implements OnInit { |
OlderNewer