Skip to content

Instantly share code, notes, and snippets.

View angular_1_4.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.scss']
})
export class CounterComponent implements OnInit {
View angular_1_3.html
<div class="counter__container">
<div class="counter__container-inner">
<h4>Counter</h4>
<div class="button-group">
<button (click)="decrement()">-</button>
<button (click)="clearCounter()">0</button>
<button (click)="increment()">+</button>
</div>
<h5>Counter: {{counter}}</h5>
</div>
View angular_1_2.scss
.counter__container {
background-color: #F0F0F0;
min-width: 100px;
margin-bottom: 20px;
.counter__container-inner {
padding: 20px;
text-align: center;
.button-group {
View angular_1_1.html
<div class="counter__container">
<div class="counter__container-inner">
<h4>Counter</h4>
<div class="button-group">
<button>-</button>
<button>0</button>
<button>+</button>
</div>
<h5>Counter: </h5>
</div>
View PHP_en_15_4_2.php
<?php
$sql ="SELECT c_title, c_description, c_headline, c_content FROM os_content WHERE c_id = 3;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
$meta_title = $result[0]['c_title'];