Tic Tac Toe Game in Angular

This is a simple Tic Tac Toe game written in Angular 2. You can find the source code here Root Component The project is again generated by angular-cli. I did not include routing in the app. There is only a root component and an HTML & CSS file for it. I also did not touch index.html Logic Let’s have a look at our component, navigate to src/app/app.component.ts. We have predefined some of our data and also we have this constructor:...

March 17, 2017 · 3 min · Ahmet Gokdayi

Simple Restify & AngularJs App

For a job application, i was asked to build an SPA app, i wanted to use AngularJS for it’s simplicity, and also wanted to include RestifyJs View Full Source Code I could just build an Angular app, too, but i needed to have some zipcode data of some places, and i found this api. They restrict you to use the api, which is only 50 requests in an hour or so....

March 11, 2017 · 7 min · Ahmet Gokdayi

Get Started With Angular 2

Angular2 is a popular Single Page Application framework lately. Before Angular2, there was AngularJS(1.xx) and angular team just call this new Angular2 as Angular We are going to set-up a starting project, talk about some important stuff about Angular What I like about Angular is it’s consistency. We seperate every stuff we can, html css and javascript. We have components, which manages a section of an html page, that we call as Views....

February 8, 2017 · 5 min · Ahmet Gokdayi

AngularJS Unsupported Media Error

So, you made an http request using AngularJs, similar to this : $http.post(api, data).then(function(response){ }); const a = (a, b) => a + b Or maybe a PUT request? It does not matter actually, but the original docs does use another snytax like this : $http({ method : 'POST', url : 'api_here' }); Let’s talk about the problem, it’s because you have to add Content-Type header value to your request, and it’s very easy to add:...

January 30, 2017 · 1 min · Ahmet Gokdayi

Angular Injectable Services

When using AngularJS(1.xx), we were defining a service like this: var app = angular.module('app',[]); app.factory('customService',function($http){ return { getAll:function(){ return $http.get('Your_Api_Url_Here'); } } }); Well, why do we need to use services? If you don’t want to write more code and when you need to change your api, if you don’t want to change more code, angular services are your friend. Generally you’d make http requests but you can use these services for anything, for example if you want to communicate with other components in the app etc....

2 min · Ahmet Gokdayi