Angular JS is a front-end framework for web applications. It allows you to extend HTML’s syntax to present dynamic content through two-way data-binding.
- Angular directives are special commands used within the framework
- All directives start with ‘ng-‘ then the name of the directive
- Expressions are written in the HTML and are wrapped with
- Two-way data binding ties the view and model together
- Angular is used for the view in MVC architecture
- M is for model (or data)
- V is for view
- Service is a small piece of code that takes care of common tasks
- $http is a service that handles communications between an http server and your application
- Deep linking looks at the location URL and manages how it maps to the current state of the page
- $scope service allows you to pass variables between the JS and the HTML
Directives for form validations:
Properties for the models:
- $pristine (class ng-pristine)
- $dirty (class ng-dirty)
- $touched (class ng-touched)
- $valid (class ng-valid)
- $invalid (class ng-invalid)
This morning our MEAN Stack and Web socket lab was due. I decided to work on something simple in order to help me get a better understanding of the technologies used, so I worked on a game of tic tac toe. Web sockets are pretty fascinating, and I hope to incorporate them into a few future projects.
So far, the game doesn’t do everything that I’d like it to do. I haven’t used the database to persist the game data, so that’s one thing to add to my ‘to do’ list. I’d also like to add the following:
- Prompting the user for their name
- When users chat, having their names appear beside any remark made
The rest of the day we did a code review of a React to do list application. React definitely seems a little easier than Angular to pick up, but I find myself wanting to spend a good chunk of time to building and piecing apart applications in order to get a better understanding of Angular as well as React.
Web sockets are a way that users can interact in real time with each other on websites. During class we did a quick tutorial where we created a chatroom – it was some pretty cool stuff. After walking through the chatroom with socket.io, we tried to add Angular to the mix, and yet again it tripped me up a bit.
In the afternoon the instructors announced the web socket lab, where we will have to build a game with the MEAN stack and use web sockets. I can’t believe how many labs we’ve had – here I thought this weekend I would be able to get a head start on my final project. Looks like I’ll be refactoring the lab that was due this morning and have to complete yet another project.
I still feel pretty shaky with Angular JS, so I’m going to attempt to do several tutorials over the weekend. I did manage to put a basic MEAN stack framework in place for my lab project that I’ll work on customizing more tomorrow. I am also going to attempt to create Tic Tac Toe.
The MEAN stack is pretty difficult to work with – at least it is for someone who is completely new to it. I enjoy working with Mongo DB, Node.js, and Express.js. The problem child in the stack is Angular – I’m realizing I’m not grasping everything that I thought I was.
Today was the last day to work on our MEAN stack lab. I decided to create an app where users can post their projects and have other users critique their projects. Users can upvote/downvote projects as well as critiques.
I was able to successfully complete the following:
- Have users create new projects, delete existing projects, and view all projects
- Have users upvote/downvote projects
- Have users add critiques for different projects
- Have users view all critiques made on projects
- Have users upvote/downvote critiques
- Seed the database with dummy data
- Use show/hide Angular directives to make a better user experience
At this time, I have yet to do the following:
- Allow users to update posts
- Add the ability to delete comments
- Create RegEx to prevent users from submitting critiques if the critique uses banned words or phrases
- Polished styling (I was only able to do some preliminary styling)
- Launch the app to Heroku
Although building this application was a huge struggle, I felt as though the application functioned a lot better than my project 3. It was also quite a learning experience!
MEAN stack application where users can upload projects and have other users upvote/downvote their projects. Users can also comment and upvote/downvote comments.
View the project
- Express JS
- Angular JS
- Node JS
We had an introduction to adding Angular to the mix when building apps with Mongo DB, Express JS, and Node JS. However, the intro was a little too brief for everyone’s liking. Essentially we walked through an exercise that incorporated Angular with the rest of the stack, but not many of us were feeling at all confident with this new component.
After attempting to complete the in-class assignment, we were introduced to our lab for the week – building a MEAN stack application. We could either work in groups or alone. Although I enjoy working with others, when I’m struggling to retain new information, I do much better being able to struggle and absorb things on my own a little bit before returning to the group. Thus I opted for working on my own project.
It was a bit of a struggle – I tried to walk through the in-class assignment several times, but was unable to build something that could function. Next I started Googling all sorts of tutorials, desperate to find a working example of a way to format and use all these different pieces together. Luckily, I finally stumbled upon something that worked and helped me add basic CRUD functionality to the app. Once I had the working pieces in place, I pretty much called it a day. I was pretty sleep deprived from the day before, but I did indeed successfully complete a large chunk for the lab.
I’m hoping that tomorrow goes well and that I can successfully refine this application. I have a sturdy foundation now–all I want to do now is add to it and read over a few documents to make sure I’m understanding everything involved with the basics for the MEAN stack.
The group project week is officially over, and I’m relieved. It was definitely a learning experience, and it was a bit tough having to tackle so much on my own. It’s a shame that I’m not that proud of the project itself, since it only incorporated some basic CRUD functionality, but I hope that the work I’ve done on it will inspire me to build something different in the future.
This weekend I plan to work on putting together a couple of stand-alone Angular apps so I can get a better feel of the language. I’m also excited to start brainstorming ideas for my next projects.
Today was the last full-day of the group project. I’m disappointed that my group’s application has minimal functionality, although I’m pretty proud that we learned quite a bit about how to work with the following technologies:
- Angular JS (although I’d really like to work through a few more tutorials)
- Mounting Angular on Rails
- Angular Material
- Creating APIs in Rails
- Deploying to Heroku while working through minification errors
The struggle is real. Working a group has made me aware of several things in the web development process. First off, planning and communication are key.
My group has run into quite a few roadblocks. We haven’t been able to successfully transform the app into the type of project we want it to be. I suppose, looking back at this project, I will look at it as a learning experience. I’ve learned quite a lot, but haven’t successfully rolled out as many features as I’d like to.
Tomorrow is our last full day to work on the project. I’m hoping we can fine-tune our MVP, and find ways to dress up the app. We shall see how it goes! I’m realizing it’s important to stay optimistic, even when things aren’t turning out the way you’d expect.
Today proved to be a day of frustration for my group – we’re struggling with Angular quite a bit. I managed to build up the back-end coupled with Angular as the front-end, however I’ve run into issues getting CRUD to function for the API. Update and show are working, it’s just a matter of getting delete and new to work.
After a day of struggling with my code, I’m on the verge of scraping everything and rebuilding. Sometimes you need to cut your losses.
Apparently the vast majority of my class is struggling with Angular, so it’s good to know that I’m not alone. It’s been a lot of hours this week spent staring at code, attempting to make things, fiddling around with existing projects, and trying so desperately to get things to click.
This morning started off with a review, and then we had the rest of the day to work on a lab. We had to build an Angular app with a basic CRUD functionality. The app was called “WDI Radio,” and if we were able to get to it, we had to figure out how to play mp3 files in the app. I almost made it that far, but was proud of myself for putting together the app fairly quickly and deploying it with Firebase – something I had never done before.