diff options
author | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-21 23:02:23 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadevchavali1@gmail.com> | 2019-02-21 23:02:23 +0000 |
commit | c11f55ca5d3eca5e75aabaee7c352596bc2f2a9d (patch) | |
tree | 071bc3dc0145bd8a0efbcb9df87968dc0724e2dc /Frontend/scripts/main.ts | |
parent | 59abc62c0727f4dee89c7251075263482fd2aa93 (diff) | |
download | newsaggregator-c11f55ca5d3eca5e75aabaee7c352596bc2f2a9d.tar.gz newsaggregator-c11f55ca5d3eca5e75aabaee7c352596bc2f2a9d.tar.bz2 newsaggregator-c11f55ca5d3eca5e75aabaee7c352596bc2f2a9d.zip |
Moved back frontend to wwwroot for simplicity
Diffstat (limited to 'Frontend/scripts/main.ts')
-rw-r--r-- | Frontend/scripts/main.ts | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Frontend/scripts/main.ts b/Frontend/scripts/main.ts deleted file mode 100644 index e68bc97..0000000 --- a/Frontend/scripts/main.ts +++ /dev/null @@ -1,49 +0,0 @@ -class Article { - Container: HTMLElement; - Title: HTMLElement; - Image: HTMLElement; - - constructor(title: string, description: string, article_link: string, image_link: string) { - // object initialisation - this.Container = document.createElement('div'); - this.Title = document.createElement('h1'); - this.Image = new Image(); - let link = document.createElement('a'); - - // attributes - link.innerText = title; - link.setAttribute('href', article_link); - this.Image.setAttribute('src', image_link); - this.Image.setAttribute('title', description); - this.Container.className = "Frame"; - - // make unit - this.Title.appendChild(link); - this.Container.appendChild(this.Title); - this.Container.appendChild(this.Image); - } - - visualise(root: HTMLElement): void { - // visualise the article for document - root.appendChild(this.Container); - } -} - -let root = document.getElementById('root'); - -let title = "Amazon reconsiders building new headquarters in New York City: WaPo"; -let description = "Description"; -let article = "https://www.wikipedia.org/"; -let image = "https://s.abcnews.com/images/Business/long-island-city-gty-jc-181112_hpMain_4x3t_384.jpg"; - -let articles: Array<Article> = [ - new Article(title, description, article, image), - new Article(title, description, article, image), - new Article(title, description, article, image), - new Article(title, description, article, image), - new Article(title, description, article, image), - new Article(title, description, article, image), - new Article(title, description, article, image) -]; - -articles.forEach(article => article.visualise(root)); |