Developing an application in Angular CLI is really fun and fast due to its nature and the features it offers to developers. One of the great features it has, is the ability to run your code using different variables. Similar to environmental variables that are distinguish per se. But what are the environment variables and what is the relation with the ionic?
A majority of web sites are SPAs, built either with Angular, Vue, React or any other framework. My personal preference is Angular but this is not the case of this topic :)
Apart from the web sites, a lot of mobile applications are hybrid built with frameworks such as Ionic.
All of them require a back-end system that handles the database calls, the heavy data processing/manipulation etc. How does the Client app (SPA or hybrid) communicates with the Server App (back-end)? I bet that the first thing that arises in your mind is the REST. And yup! You are right. This is not the only solution though. There are other solutions that you should consider.
From the title of this post, you can imagine what the solution I am talking about is :). GraphQL.
Let's see what this is and how we can use it.
Have you ever had the need two components to communicate each other? Of course you had!
I bet that when you hear components communication or components interaction, you automatically think of @input @output decorators.
Say that we have two components, parent and child. You want the parent component to interpolate on its template a property from the child component. How can we do this?
In this post we will try together to build a form consisted of different components and we will try various implementations to achieve the best architecture. The final pattern that we will implement is the smart dumb.
We will try 4 different approaches and soon I will create a 5th one which will use the exportAs.
The post is quite long but it worth's diving in :)
Our form will have:
The protractor.conf.js file is meant to offer a configuration for our e2e tests. The default which come with each new angular-cli app is very good and works really well. We shouldn't extend it unless we expect more.
Although it works well on localhost, what about the CI server?
On this post I wont explain what kind of configuration you might need for your CI, but how to separate the configuration and how to use it
As web developers we have been developing web forms almost on every app. How many times have you spent time searching on google (or bing - no offense ) on finding solutions to pre-select an option on a select control while using angular? Yeah I know! Many times. And when you read the solution you are like "Ohh yess!"
Let's demystify this
What are the differences? The main difference is the scoping
In nutshell, block scope is the code that is enclosed in curly braces
Node.js is single threaded and by default utilizes only one core of the CPU no matter how many cores the CPU has. Of course there are solutions of how to use all the cores but it's not part of this post. Just for the record, there are packages that does this job efficiently. Have a look at this link pm2.keymetrics.io/
Well, what am I trying to solve here? Imagine that you have 2 different endpoints on your application, and one of them needs a lot of processing time. What the problem would be?
What are the promises?
A promise is an alternative way which allows us to handle asynchronous operations in a more elegant way than callbacks
Let's assume a simple story which will help us understand this. (well OK, I know that its not the best example you've ever read)
A father asks his son to go and buy a newspaper. The father is awaiting for the newspaper and will start reading it when his son returns back. On the other hand, the father knows that his son, who loves playing out in the yard, has some possibilities to fall down and start crying. In this case he won't read his newspaper and he will have to care of his son.
There are two cases in the story; the father will read the newspaper. The father won't read the newspaper.
* In the company that I work for, we have a ceremony, called DOJO, in which any employer can present his/her ideas about any subject he/she wants to share (though we are trying to be focused on technological stuff). As such, this slide presentation was one of our DOJOs
I am a senior software engineer who loves scuba diving and hiking. A dog type person who owns two cats