Finished the project.

This commit is contained in:
Batuhan Berk Başoğlu 2024-02-09 00:19:21 -05:00
parent 753967d4f5
commit b5dcb71080
35 changed files with 130 additions and 139 deletions

File diff suppressed because one or more lines are too long

View file

@ -6,7 +6,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="stylesheet" href="styles-5INURTSO.css"></head>
<body><!--nghm-->
<app-root _nghost-ng-c1513193873 ng-version="17.1.3" ngh="0" ng-server-context="ssg"><main _ngcontent-ng-c1513193873 class="main"><h1 _ngcontent-ng-c1513193873>To-do CRUD</h1><h3 _ngcontent-ng-c1513193873>Add</h3><form _ngcontent-ng-c1513193873 action="javascript:void(0);" method="POST" onsubmit="addItem()"><input _ngcontent-ng-c1513193873 type="text" id="add-name" placeholder="New to-do"><input _ngcontent-ng-c1513193873 type="submit" value="Add"></form><div _ngcontent-ng-c1513193873 id="editForm"><h3 _ngcontent-ng-c1513193873>Edit</h3><form _ngcontent-ng-c1513193873 action="javascript:void(0);" onsubmit="updateItem()"><input _ngcontent-ng-c1513193873 type="hidden" id="edit-id"><input _ngcontent-ng-c1513193873 type="checkbox" id="edit-isComplete"><input _ngcontent-ng-c1513193873 type="text" id="edit-name"><input _ngcontent-ng-c1513193873 type="submit" value="Save"><a _ngcontent-ng-c1513193873 onclick="closeInput()" aria-label="Close"></a></form></div><p _ngcontent-ng-c1513193873 id="counter"></p><table _ngcontent-ng-c1513193873><tr _ngcontent-ng-c1513193873><th _ngcontent-ng-c1513193873>Is Complete?</th><th _ngcontent-ng-c1513193873>Name</th><th _ngcontent-ng-c1513193873></th><th _ngcontent-ng-c1513193873></th></tr><tbody _ngcontent-ng-c1513193873 id="todos"></tbody></table></main><router-outlet _ngcontent-ng-c1513193873></router-outlet><!----></app-root>
<script src="polyfills-RX4V3J3S.js" type="module"></script><script src="main-6RBWMYLE.js" type="module"></script>
<app-root _nghost-ng-c3526056911 ng-version="17.1.3" ngh="0" ng-server-context="ssg"><main _ngcontent-ng-c3526056911 class="main"><h1 _ngcontent-ng-c3526056911>Calling the API using Angular</h1><h3 _ngcontent-ng-c3526056911>Get the Posts</h3><p _ngcontent-ng-c3526056911>Click to this button to receive all the API data.</p><a _ngcontent-ng-c3526056911 href="javascript:void(0)" role="button" class="btn btn-lg btn-primary"> Get the Posts </a></main><router-outlet _ngcontent-ng-c3526056911></router-outlet><!----></app-root>
<script src="polyfills-RX4V3J3S.js" type="module"></script><script src="main-DASB26HH.js" type="module"></script>
<script id="ng-state" type="application/json">{"__nghData__":[{"c":{"28":[]}}]}</script></body></html>
<script id="ng-state" type="application/json">{"__nghData__":[{"c":{"9":[]}}]}</script></body></html>

File diff suppressed because one or more lines are too long

View file

@ -1,2 +0,0 @@
import './polyfills.server.mjs';
import{a as p,b as t,c as e,d as i,e as o,f as d,m as a,o as l,p as s,s as c,w as u,z as f}from"./chunk-LGZFYCZH.mjs";var v=(()=>{let n=class n{constructor(){this.title="my-app"}};n.\u0275fac=function(m){return new(m||n)},n.\u0275cmp=p({type:n,selectors:[["app-root"]],standalone:!0,features:[d],decls:29,vars:0,consts:[[1,"main"],["action","javascript:void(0);","method","POST","onsubmit","addItem()"],["type","text","id","add-name","placeholder","New to-do"],["type","submit","value","Add"],["id","editForm"],["action","javascript:void(0);","onsubmit","updateItem()"],["type","hidden","id","edit-id"],["type","checkbox","id","edit-isComplete"],["type","text","id","edit-name"],["type","submit","value","Save"],["onclick","closeInput()","aria-label","Close"],["id","counter"],["id","todos"]],template:function(m,g){m&1&&(t(0,"main",0)(1,"h1"),o(2,"To-do CRUD"),e(),t(3,"h3"),o(4,"Add"),e(),t(5,"form",1),i(6,"input",2)(7,"input",3),e(),t(8,"div",4)(9,"h3"),o(10,"Edit"),e(),t(11,"form",5),i(12,"input",6)(13,"input",7)(14,"input",8)(15,"input",9),t(16,"a",10),o(17,"\u2716"),e()()(),i(18,"p",11),t(19,"table")(20,"tr")(21,"th"),o(22,"Is Complete?"),e(),t(23,"th"),o(24,"Name"),e(),i(25,"th")(26,"th"),e(),i(27,"tbody",12),e()(),i(28,"router-outlet"))},dependencies:[u]});let r=n;return r})();var x=[];var h={providers:[f(x),s()]};var S={providers:[c()]},y=a(h,S);var b=()=>l(v,y),U=b;export{U as a};

File diff suppressed because one or more lines are too long

View file

@ -9,5 +9,5 @@
<link rel="stylesheet" href="styles-5INURTSO.css"></head>
<body>
<app-root></app-root>
<script src="polyfills-RX4V3J3S.js" type="module"></script><script src="main-6RBWMYLE.js" type="module"></script></body>
<script src="polyfills-RX4V3J3S.js" type="module"></script><script src="main-DASB26HH.js" type="module"></script></body>
</html>

View file

@ -1,2 +1,2 @@
import './polyfills.server.mjs';
import{a}from"./chunk-EPF7UM6E.mjs";import"./chunk-LGZFYCZH.mjs";import"./chunk-VVCT4QZE.mjs";export{a as default};
import{a}from"./chunk-PZASK5JP.mjs";import"./chunk-4R55AP5V.mjs";import"./chunk-VVCT4QZE.mjs";export{a as default};

View file

@ -1,2 +1,2 @@
import './polyfills.server.mjs';
import{g as f,h as g,i as h,j as p,k as y,l as C,q as E,r as w,t as N,u as A,v as I,x as P,y as S}from"./chunk-LGZFYCZH.mjs";import{i as l,j as d,k as u}from"./chunk-VVCT4QZE.mjs";function a(e,n,i,t=""){return d(this,null,function*(){for(let r of e){let{path:o,redirectTo:c,loadChildren:T,children:R}=r;if(o===void 0)continue;let s=x(t,o);if(c!==void 0){yield{route:s,success:!1,redirect:!0};continue}if(/[:*]/.test(o)){yield{route:s,success:!1,redirect:!1};continue}if(yield{route:s,success:!0,redirect:!1},R?.length&&(yield*u(a(R,n,i,s))),T){let m=yield new l(P(r,n,i).toPromise());if(m){let{routes:_,injector:L=i}=m;yield*u(a(_,n,L,s))}}}})}function v(e,n){return d(this,null,function*(){let i=y(C,"server",[{provide:E,useValue:{document:n,url:""}},{provide:f,useFactory:()=>{class t extends f{ignoredLogs=new Set(["Angular is running in development mode."]);log(o){this.ignoredLogs.has(o)||super.log(o)}}return new t}},...w])();try{let t;V(e)?t=yield new l(e()):t=(yield new l(i.bootstrapModule(e))).injector.get(h),yield new l(p(t));let r=t.injector,o=r.get(S);if(o.config.length===0)yield{route:"",success:!0,redirect:!1};else{let c=r.get(g);yield*u(a(o.config,c,r))}}finally{i.destroy()}})}function V(e){return typeof e=="function"&&!("\u0275mod"in e)}function x(...e){return e.filter(Boolean).join("/")}export{v as extractRoutes,I as renderApplication,A as renderModule,f as \u0275Console,N as \u0275SERVER_CONTEXT};
import{B as P,C as S,i as f,j as g,k as h,l as p,m as y,n as C,u as E,v as w,x as N,y as A,z as I}from"./chunk-4R55AP5V.mjs";import{i as l,j as d,k as u}from"./chunk-VVCT4QZE.mjs";function a(e,n,i,t=""){return d(this,null,function*(){for(let r of e){let{path:o,redirectTo:c,loadChildren:T,children:R}=r;if(o===void 0)continue;let s=x(t,o);if(c!==void 0){yield{route:s,success:!1,redirect:!0};continue}if(/[:*]/.test(o)){yield{route:s,success:!1,redirect:!1};continue}if(yield{route:s,success:!0,redirect:!1},R?.length&&(yield*u(a(R,n,i,s))),T){let m=yield new l(P(r,n,i).toPromise());if(m){let{routes:_,injector:L=i}=m;yield*u(a(_,n,L,s))}}}})}function v(e,n){return d(this,null,function*(){let i=y(C,"server",[{provide:E,useValue:{document:n,url:""}},{provide:f,useFactory:()=>{class t extends f{ignoredLogs=new Set(["Angular is running in development mode."]);log(o){this.ignoredLogs.has(o)||super.log(o)}}return new t}},...w])();try{let t;V(e)?t=yield new l(e()):t=(yield new l(i.bootstrapModule(e))).injector.get(h),yield new l(p(t));let r=t.injector,o=r.get(S);if(o.config.length===0)yield{route:"",success:!0,redirect:!1};else{let c=r.get(g);yield*u(a(o.config,c,r))}}finally{i.destroy()}})}function V(e){return typeof e=="function"&&!("\u0275mod"in e)}function x(...e){return e.filter(Boolean).join("/")}export{v as extractRoutes,I as renderApplication,A as renderModule,f as \u0275Console,N as \u0275SERVER_CONTEXT};

File diff suppressed because one or more lines are too long

View file

@ -2808,6 +2808,19 @@
"linux"
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.9.6",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.6.tgz",
"integrity": "sha512-ch7M+9Tr5R4FK40FHQk8VnML0Szi2KRujUgHXd/HjuH9ifH72GUmw6lStZBo3c3GB82vHa0ZoUfjfcM7JiiMrQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/@schematics/angular": {
"version": "17.1.3",
"resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-17.1.3.tgz",

View file

@ -1,38 +1,10 @@
<main class="main">
<h1>To-do CRUD</h1>
<h3>Add</h3>
<form action="javascript:void(0);" method="POST" onsubmit="addItem()">
<input type="text" id="add-name" placeholder="New to-do">
<input type="submit" value="Add">
</form>
<div id="editForm">
<h3>Edit</h3>
<form action="javascript:void(0);" onsubmit="updateItem()">
<input type="hidden" id="edit-id">
<input type="checkbox" id="edit-isComplete">
<input type="text" id="edit-name">
<input type="submit" value="Save">
<a onclick="closeInput()" aria-label="Close">&#10006;</a>
</form>
</div>
<p id="counter"></p>
<table>
<tr>
<th>Is Complete?</th>
<th>Name</th>
<th></th>
<th></th>
</tr>
<tbody id="todos"></tbody>
</table>
<script src="js/site.js" asp-append-version="true"></script>
<script type="text/javascript">
getItems();
</script>
<h1>Calling the API using Angular</h1>
<h3>Get the Posts</h3>
<p>Click to this button to receive all the API data.</p>
<a (click)="loadPosts()" class="btn btn-lg btn-primary" href="javascript:void(0)" role="button">
Get the Posts
</a>
</main>

View file

@ -1,13 +1,23 @@
import { Component } from '@angular/core';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { RouterOutlet } from '@angular/router';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet],
imports: [RouterOutlet, HttpClientModule],
templateUrl: './app.component.html',
styleUrl: './app.component.css'
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-app';
}
constructor(private http: HttpClient) {
}
loadPosts() {
this.http.get("https://api.hatchways.io/assessment/blog/posts?tag=tech").subscribe((response)=>{
alert(JSON.stringify(response));
})
}
}