<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ebba on Medium]]></title>
        <description><![CDATA[Stories by Ebba on Medium]]></description>
        <link>https://medium.com/@ebbawer?source=rss-c8ab05fa6488------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gfvRvZ_qimpuDR5zXGiKpw.png</url>
            <title>Stories by Ebba on Medium</title>
            <link>https://medium.com/@ebbawer?source=rss-c8ab05fa6488------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:20:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ebbawer/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Javascript: Difference between Null and Undefined]]></title>
            <link>https://medium.com/@ebbawer/javascript-difference-between-null-and-undefined-34db5c6e0071?source=rss-c8ab05fa6488------2</link>
            <guid isPermaLink="false">https://medium.com/p/34db5c6e0071</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[undefined]]></category>
            <category><![CDATA[null]]></category>
            <dc:creator><![CDATA[Ebba]]></dc:creator>
            <pubDate>Thu, 05 Apr 2018 09:27:52 GMT</pubDate>
            <atom:updated>2018-04-09T08:53:23.279Z</atom:updated>
            <content:encoded><![CDATA[<p>In my former <a href="https://medium.com/@aniansson/what-is-complex-and-primitive-data-in-javscript-cf90dd78f4b8">story</a>, I mentioned the two types of data that exist in <strong>Javascript</strong>, <em>complex</em> and <em>primitive</em>. If you haven’t read it, you can read it <a href="https://medium.com/@aniansson/what-is-complex-and-primitive-data-in-javscript-cf90dd78f4b8">here</a>. Two types of data that are considered primitive is both undefined and null. Two types that seems pretty similar, huh? Well not really, and here is my explanation why:</p><h4>First of all, what is null and undefined?</h4><p><strong>Undefined </strong>—is basically that you can set a variable to undefined. Why would you want to do that? Probably because there are times when an object shouldn’t store any data anymore. For example when a user is logged into our application we might want to store their information in the local browser storage as a JS object. In the event that the user logs out, we no longer need this object on the local storage so we can set it to undefined.</p><p>How to set the variable to undefined:</p><pre>var car; // setting a variable</pre><pre>car = undefined; // setting the variable to undefined</pre><p><strong>Null</strong> — is another word for <em>nothing</em>. In <em>German</em> null means <em>zero</em>, which is also considered nothing. Good reminder ;) When you set something to null, you are literally emptying it.</p><p>Okay, so now you may understand the concept of these two different datatypes, so what is the difference? Let me introduce you to my pals, typeof and node in the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*nmxRyLDqbpB1P9pOWOxS7g.png" /><figcaption>Tada! There you go!</figcaption></figure><p>Okay, so to explain this in a simpler form; null is considered an <em>object</em>, whilst undefined is considered <em>undefined</em>. Which means they are <strong>not</strong> the <strong>same</strong> <strong>data type</strong>. However, null and undefined are the <strong>same value</strong>, they are considered to both being <strong>nothing</strong>.</p><p><em>Hope you got some clarifications! If not, just leave a comment :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34db5c6e0071" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javscript: Complex and Primitive Data]]></title>
            <link>https://medium.com/@ebbawer/what-is-complex-and-primitive-data-in-javscript-cf90dd78f4b8?source=rss-c8ab05fa6488------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf90dd78f4b8</guid>
            <category><![CDATA[null]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[primitive-data]]></category>
            <category><![CDATA[complex-data]]></category>
            <category><![CDATA[boolean]]></category>
            <dc:creator><![CDATA[Ebba]]></dc:creator>
            <pubDate>Wed, 04 Apr 2018 14:31:39 GMT</pubDate>
            <atom:updated>2018-04-09T08:46:36.820Z</atom:updated>
            <content:encoded><![CDATA[<p>I joined <a href="https://medium.com/@podiihq">@</a>podiihq mob session yesterday, for the first time. And we discussed datatypes in Javascript. I learned that there are two different categories within datatypes— so get ready to be enlightened!</p><p>The two different categories are:</p><ol><li><strong>Primitive data</strong> — which is the lowest type of data. All other data is based on primitive data.</li><li><strong>Complex data </strong>— in order to create complex data, you need primitive data. In other words, complex data is based on primitive data.</li></ol><p><em>So what is included in primitive and complex data?</em></p><h4>Primitive Data Includes:</h4><p><strong>Strings</strong> — anything inside a single ‘I am a string’ , or double quotation “I am also a string”</p><p><strong>Number</strong> — anything that is a number, either with or without a decimal. This is considered a number: 24, and this is also considered a number 24.46</p><p><strong>Boolean </strong>— True or False</p><p><strong>Undefined </strong>— I have no better way of explaining undefined than showing you this:</p><pre>var car; // setting a variable</pre><pre>car = undefined; // setting the variable to undefined</pre><p>You may be asking, why you would want to set a variable to undefined? Well I had the same question, and therefore asked <a href="https://medium.com/u/c93118b21336">sigu</a>. His answer was that it is useful when logging out a user, since you don’t really want to store any of the users data on the browser storage anymore, once its logged out. Therefore you set the user object on the browser storage to undefined.</p><p><strong>Null</strong> — is considered a primitive data by some, and by others not. I think it may be because null is considered an <em>object (which apparently is considered a bug in JS, since it should be null)</em>, and an <em>object</em> is in return considered a complex data. Messy, messy. But anyhow, null means nothing. So if you set an object to null, you are basically emptying it.</p><h4>So what is considered Complex data?</h4><p>Here we can use the typeof operator to find out what kind of complex data there is, and it returns 2 types of data:</p><ol><li><strong>Function</strong></li><li><strong>Object</strong></li></ol><p>Which, if you think about it, makes sense. A <em>function</em> and an <em>object</em> can include any primitive data, but not the other way around. In other words you kind of need primitive data to define a function or an object.</p><p><em>I hope this explanation was helpful! If there are any typos/errors in the text, please let me know — so I can get enlightened :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf90dd78f4b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting an API to an Angular 4 front-end application]]></title>
            <link>https://medium.com/craft-academy/connecting-an-api-to-an-angular-4-front-end-application-e0fc9ea33202?source=rss-c8ab05fa6488------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0fc9ea33202</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[angular2]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Ebba]]></dc:creator>
            <pubDate>Mon, 24 Apr 2017 07:56:26 GMT</pubDate>
            <atom:updated>2017-06-22T17:06:52.770Z</atom:updated>
            <content:encoded><![CDATA[<p>For Gothenburgh Tech Week (May 1–7) this year<strong> Craft Academy</strong> is presenting a short talk on <strong><em>“What is an app and how do I make one?”, </em></strong>that<strong><em> </em></strong><a href="https://medium.com/u/c915b04f8f9a"><strong><em>Amber Wilkie</em></strong></a> and I will be hosting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rc8lKP4_cM-E0ppMc9ekLQ.png" /></figure><p>To get prepared for my first ever professional talk, I may start getting prepared and work on how to speak programming = this blogpost. Follow along :)</p><h4>The API</h4><p>The API is built by Amber — so therefore I will not talk about the API. Although I can say that its built with Ruby on Rails and allows one to manipulate a contact form<em>. </em>When a form has been filled out, it creates a Contact in the back-end database. This information will be available in an API endpoint Amber created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHfsnUwhp1iOBbyCdHk04A.png" /><figcaption><em>(Link-</em><a href="https://address-book-demo.herokuapp.com/"><em>https://address-book-demo.herokuapp.com</em></a><em>)</em></figcaption></figure><h4>Setting up a new Angular 4 application</h4><p>I will start from the beginning. Make sure you have Node.js installed on your machine, follow the instructions here: <a href="https://nodejs.org/en/"><em>https://nodejs.org/en/</em></a>. When that is done run .node -v to test that evverything is up to date. And just in case test so you have the latset version of npm; .npm -v otherwise do: .npm install npm -g.</p><p>Now we are ready to install angular and its packages on your computer:</p><pre>$npm install -g @angular/cli</pre><p>We are using /cli — due to it being very simple when creating, mananging and building, it automatically creates new projects and some useful commands for continue building in the app. Its easier than to having to do everything manually.</p><p>Then create a new project:</p><pre>$ng new my_new_project</pre><pre>$cd my_new_project</pre><p>And then to run the server: <em>(</em><a href="http://localhost:4200/"><em>http://localhost:4200</em></a><em>)</em></p><pre>$ng serve</pre><h4>The Angular 4 app</h4><p>If you go through your files now, you may see that you have automatically gotten a component and a module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*vcs9G17OJYwbZpww17yoNg.png" /></figure><p>The component defines the applications logic that supports the view. The component interacts with the view through properties and methods. The Angular application architecture is built up with components. You nest components wihtin each other to make it possible to build single page websites. The app.component.ts is our root component.</p><p>While the module is a container for the different parts in the application — controllers, services, filters and directives for example — which all together will group the whole apps functionality. It’s also where you import necessary dependencies and external modules, and identify the providers and components. Basically it bootstraps the application. In our app the app.module.ts is our root module.</p><p>And you probably know what the .html and .css files do. If not, the .html is where you add what you want the view to look like. And the .css is what we use to make the tags more beautiful and change the different elements, that have been added to the .html file. <em>The </em>.spec<em> file we can just ignore — since it has nothing to do with what we are building for the moment.</em></p><h4>Connecting the API to our app</h4><p>Let me just start by saying, don’t overcomplicate it. Which is easier said than done. When I started creating the front-end, I made 6 new files — hoping to get a response from the back-end. Did it work? No. It should not be that hard I thought after a day. So a project that should actually have taken about an hour, took a day and a half… <strong>One of the reasons I am writing this post, to show you how easy it is.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*ES1LOTkxwAI7amdqhMoD4A.png" /></figure><p>So let’s go into our app.component.ts file. This will be where we are going to call the API.</p><p>We need to make sure that it is imported into the module and identify it as a provider:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*E6L-JXMKbKBOCvKKP39jRQ.png" /></figure><p>Why you may ask. It’s because we will need to expose the API, and only a provider can do that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*zEZyXhDw8ITF0XuqvoHk5g.png" /></figure><p>Lets import some required libraries for the app to behave as we want.</p><p>We need http— a class that performs http requests, as well as response, when a http request returns, it will emit a response. .map helps us manipulate the data, and in this case it we are calling the .json method on the response because the actual response is not a collection of data but a JSON string.</p><p>Then lets call the apiURL and set it to private. Why are we setting it to private you may ask, it’s because we can call it within this AppComponent class, only. After that we just write a new method (getData()) that gets the response from the API. Let’s also set the response to<em> json —</em> so we get the body<em>.</em> We also need to define the method — which we are doing right under the console.log<em>.</em></p><p>After that we need somewhere to store the data — to later on show it in the view. So we need to assign a new variable. We are calling it data and setting it to anything right now. After that, a new method that gets the response from the <em>API</em> and getData() method that we later on store inside the variable data<em>. </em><strong>Now we have succesfully connected our Angular app to our back end. </strong><em>Lets see if it actually works.</em></p><h4>Displaying our data</h4><p>If you run your server and open your browser. You probably will only see <strong>“app works!”</strong>. But if you look beneath <em>(in other words, open up your console) </em>you might see that we are getting some kind of object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I803DZGWtWSyjcbmL0N9Qw.png" /></figure><p>Well this obejct actually has our data! Open up the object in the object, and <em>tada (!)</em> — you now have your data from the API. So how shall we get the data to the view? <strong>Once again, it’s much simpler than you think.</strong></p><p>In Angular 4 there is a directive called *NgFor<strong><em> </em></strong>— quite helpful actually. This particular directive instantiates a template once per item from an iterable. In other words, it loops through an item from the iterable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*rEb7vsPnrtBifocgtz-gNg.png" /></figure><p>So in our code, we simply assign an attribute (contacts) with the data from contacts. data is where we stored the response from the API and <em>contacts</em> is what the API has called the arrays. Then we assign all attributes <em>(that the API has)</em> to the contact. If anything seems unclear, like the attributes etc. Check what the console has given you. For example in my case, I have an array (data) in an array (contacts) therefore its data.contacts and not just data. Same goes for the attributes. The let contact however you could name whatever, like let ebbaisbest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*HenCrPBjrlR1C0WO8HGrSQ.png" /></figure><p>This is the result, and as you see everything is on repeat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*2M0TpUJ3SbtMlwF1pKMbTw.png" /></figure><p>So to divide them into separate divs <em>(and once again, much EASIER than thought), </em>just<em> </em>add another div into the container. Pro-tip, don’t go googling <em>“How to repeat one array at a time ngFor Angular 4”.</em> This is how you do it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*yucUqtlOyPXV5v0onHKvdg.png" /></figure><p>And voila, you got yourself some nice<em> “contact cards”. </em>Now just add some nice styling <em>(will not be taught in this particular blog post) </em>and you got yourself a webpage that people may actually enjoy.</p><p>If you by any chance had a hard time connecting your API to your front-end or just loved my awesome blog post and want to get to know me, please join Craft Academy’s talk at Gothenburgh Tech Week:</p><p><strong><em>Link to FB event if you might be interested </em></strong><a href="https://www.facebook.com/events/797060440441434/permalink/797085393772272/?notif_t=like&amp;notif_id=1492464121160466"><em>https://www.facebook.com/events/797060440441434/permalink/797085393772272/?notif_t=like&amp;notif_id=1492464121160466</em></a><em>)</em></p><h4>Some nice thanks to:</h4><ul><li><a href="https://docs.angularjs.org/guide/">AngularJS</a></li><li><a href="https://scotch.io/tutorials/angular-2-http-requests-with-observables">Angular 2 HTTP Requests with Observables</a></li></ul><p><a href="https://www.udemy.com/user/maximilian-schwarzmuller/"><strong>Maximilian Schwarzmüller</strong></a><strong>’s </strong>Udemy’s course on Angular 4 <em>(highly recommended)</em></p><p><a href="https://medium.com/u/c915b04f8f9a">Amber Wilkie</a> in Gothenburgh and <a href="https://medium.com/u/c93118b21336">sigu</a> in Kenya.</p><p><strong>Would you like to know more about what we do at CraftAcademy? Follow us here on </strong><a href="https://medium.com/craft-academy"><strong>Medium</strong></a><strong>, on </strong><a href="https://www.facebook.com/craftacademysweden/"><strong>Facebook</strong></a><strong>, </strong><a href="https://twitter.com/CraftAcademySE"><strong>Twitter</strong></a><strong> or </strong><a href="https://www.craftacademy.se/english/"><strong>visit our website</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0fc9ea33202" width="1" height="1" alt=""><hr><p><a href="https://medium.com/craft-academy/connecting-an-api-to-an-angular-4-front-end-application-e0fc9ea33202">Connecting an API to an Angular 4 front-end application</a> was originally published in <a href="https://medium.com/craft-academy">Nomads Of Code</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PR Descriptions]]></title>
            <link>https://medium.com/@ebbawer/pr-descriptions-6acc06f0f50?source=rss-c8ab05fa6488------2</link>
            <guid isPermaLink="false">https://medium.com/p/6acc06f0f50</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Ebba]]></dc:creator>
            <pubDate>Mon, 05 Dec 2016 08:59:03 GMT</pubDate>
            <atom:updated>2016-12-05T08:59:03.723Z</atom:updated>
            <content:encoded><![CDATA[<pre>Waffle Story: [paste Waffle tracker link here]<br><br>Changes proposed in this pull request:<br><br>[item 1 - replace me] [item 2 - replace me]<br><br>What I have learned working on this feature: [If you don&#39;t put anything here you are doing it wrong!]<br><br>Screenshots: [If you made some visual changes to the application please upload screenshots here, or remove this section]<br><br>Ready for review! [If ready]</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6acc06f0f50" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>