-
-
-
-
-
-
-
-
-
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index d486ff3..b0e9cb3 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,10 +1,43 @@
-import { Component } from '@angular/core';
+import {Component, OnInit} from '@angular/core';
+
+export interface MagicalMoments {
+ author: string;
+ background_image: string;
+ publish_date: string;
+ backstory: string;
+ answer: string;
+}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
-export class AppComponent {
- title = 'cards';
+export class AppComponent implements OnInit{
+ magicalMoments : MagicalMoments[] = [
+ {
+ author:"Ben Mathekga",
+ background_image:"https://via.placeholder.com/150",
+ publish_date:"2021-06-29T07:54:36Z",
+ backstory:"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
+ answer:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum is simply dummy text of the printing and typesetting industry."
+ },
+ {
+ author:"Anathi Maka-Mlibo Mase",
+ background_image:"https://via.placeholder.com/150",
+ publish_date:"2021-06-29T07:54:36Z",
+ backstory:"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
+ answer:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry."
+ },
+ {
+ author:"Phumeza Ntantiso",
+ background_image:"https://via.placeholder.com/150",
+ publish_date:"2021-06-29T07:54:36Z",
+ backstory:"Lorem Ipsum is simply dummy text of the printing and typesetting industry.",
+ answer:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry."
+ }
+ ];
+
+ ngOnInit() {
+ }
}
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 8dfc1d6..443124b 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -2,10 +2,12 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
+import { CardComponent } from './card/card.component';
@NgModule({
declarations: [
- AppComponent
+ AppComponent,
+ CardComponent
],
imports: [
BrowserModule
diff --git a/src/app/card/card.component.css b/src/app/card/card.component.css
new file mode 100644
index 0000000..120facc
--- /dev/null
+++ b/src/app/card/card.component.css
@@ -0,0 +1,18 @@
+.card{
+ border-radius: 2px;
+ color: rgba(0,0,0,.87);
+ background: #fff;
+ box-shadow: 0 8px 17px 0 rgb(0 0 0 / 20%), 0 6px 20px 0 rgb(0 0 0 / 19%);
+}
+
+.card-item{
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+}
+
+.card-item-text{
+ display: flex;
+ flex-direction: column;
+ padding: 0.5em;
+}
diff --git a/src/app/card/card.component.html b/src/app/card/card.component.html
new file mode 100644
index 0000000..be16ad8
--- /dev/null
+++ b/src/app/card/card.component.html
@@ -0,0 +1,10 @@
+
+
+
+
{{magicalMoment.author}}
+
{{magicalMoment.publish_date | date }}
+
{{magicalMoment.backstory}}
+
+
+
+
diff --git a/src/app/card/card.component.spec.ts b/src/app/card/card.component.spec.ts
new file mode 100644
index 0000000..3093fd5
--- /dev/null
+++ b/src/app/card/card.component.spec.ts
@@ -0,0 +1,25 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { CardComponent } from './card.component';
+
+describe('CardComponent', () => {
+ let component: CardComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ declarations: [ CardComponent ]
+ })
+ .compileComponents();
+ });
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(CardComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/card/card.component.ts b/src/app/card/card.component.ts
new file mode 100644
index 0000000..73d4f64
--- /dev/null
+++ b/src/app/card/card.component.ts
@@ -0,0 +1,12 @@
+import {Component, Input} from '@angular/core';
+import {MagicalMoments} from "../app.component";
+
+@Component({
+ selector: 'app-card',
+ templateUrl: './card.component.html',
+ styleUrls: ['./card.component.css']
+})
+export class CardComponent {
+ @Input()
+ magicalMoment: MagicalMoments | undefined;
+}
diff --git a/src/assets/file.json b/src/assets/file.json
new file mode 100644
index 0000000..8e14d78
--- /dev/null
+++ b/src/assets/file.json
@@ -0,0 +1,23 @@
+[
+ {
+ "author":"Ben Mathekga",
+ "background_image":"/media/4f0d2954-2bb7-4948-a65b-fc0f7b2074e5.jpg",
+ "publish_date":"2021-06-29T07:54:36Z",
+ "backstory":"Mr Kennedy's* wife recently passed away and to show our condolences, we arranged for a sympathy care pack to be delivered to his home.",
+ "answer":"
Thank you very much for the beautiful flowers and lovely chocolate basket. I do appreciate it.
Kind regards Mr. Kennedy
"
+ },
+ {
+ "author":"Anathi Maka-Mlibo Mase",
+ "background_image":"/media/30cfd042-f3b4-47c8-9647-50f2366ee148_Dk0oNBC.jpg",
+ "publish_date":"2021-06-29T07:54:36Z",
+ "backstory":"With the cold winter months fast approaching, everybody needs a little shelter from the 'storm'. Each winter warmer care package contains a soft blanket, scarf, beanie, hot chocolate, coffee and delicious snacks, as well as. retail gift card.",
+ "answer":"
Thank you ever so much iWYZE for the wonderful gift you gave me.
I am highly appreciating your unconditional giving. May the most-high God I serve richly bless you all in Jesus Christ's name
"
+ },
+ {
+ "author":"Phumeza Ntantiso",
+ "background_image":"/media/a7d7a6f1-5b1a-44d5-9b5a-b685a7a5b7a2.jpg",
+ "publish_date":"2021-06-29T07:54:36Z",
+ "backstory":"Our customer, Mrs. Ngidi* has been through a very challenging medical procedure. Magical Moments sent her a personalised care pack to brighten her day and showing our support during a difficult time.",
+ "answer":"
Thank you!
I have just received my package. I'm overwhelmed with emotion. You have really lifted my spirits!
"
+ }
+]
\ No newline at end of file
diff --git a/src/styles.css b/src/styles.css
index 90d4ee0..e1c9a92 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -1 +1,7 @@
/* You can add global styles to this file, and also import other style files */
+html {
+ box-sizing: border-box;
+}
+*, *:before, *:after {
+ box-sizing: inherit;
+}
diff --git a/tsconfig.json b/tsconfig.json
index 6df8283..265891a 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -5,7 +5,7 @@
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
- "strict": true,
+ "strict": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
@@ -19,7 +19,9 @@
"lib": [
"es2018",
"dom"
- ]
+ ],
+ "resolveJsonModule": true,
+ "allowSyntheticDefaultImports": true
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,