This weekend I spent some time with RequireJs setting up a nice environment for AngularJS development. The AngularJs yeoman/yo generator doesn't currently support RequireJs with AngularJs. So I have been "SOL" having no standard seed project I can use to get up and running very quickly. This week I finally got to it. AngularJs is made for running tests so I spent a lot of time kinda going over the best practices of and building up the right seed project for me that will also allow me to build me app very easily inside of PHPStorm/Webstorm. The new AngularJs and RequireJs and Karma seed project is on github now, ready for me to clone it. Anyone needing a good start project is welcome to clone it as well. I hope to port this over to yeoman/yo and get it all working from there. I added a Karma config file and r.js build file as well so that these two things could be as easy as possible.
One of my favorite things to do with jQuery is to make widgets. I love them, they are just kinda cute. But there comes a time when extending widgets might be a better idea than starting one from scratch. One possible case might be when you need a modal window and you want to just add some special method to the ones already included in the jQuery core. So the question is how do you extend the jQuery UI widgets. Well here is the answer.
Aside from promises and the deferred object in jQuery there is also progress. As we have seen in the other post about promises, promises only resolve (done or fail) after an action is performed. We cannot trigger the change of state in a promise we only register for its events. We have no control over its state. We cannot tell a promise to resolve. We also looked at the $.Deferred object. The $.Deferred object gave us a little bit more control over a promise and we saw that it is indeed a promise. We can control state on and trigger its done() or fail() methods and notify any registered call backs. The advantage of using promises is that it not only cleans our code but provides a nice Pub/Sub substitution for one off events with distinct outcomes. But now we come to the progress method added in jQuery 1.7 to promises. Lets take a look at some code.
This is less of a technical post and more of a excited school boy announcement. Anyways I am off getting this all wired up and ready to hack some code. Took a while but yeoman is now available for windows. I hate to admit it sometimes because everyone else I know uses macs but I can't justify a mac. Besides I run windows 7 which I love. Anyways I have been waiting on Yeoman 1.0 to be release for testing (Beta) for windows. I think I am about 1 week behind but I finally installed it. From the very first time I installed yeoman I have loved it. Even version 0.9 was not that bad and it did help with all the crappy set work. But now in version 1.0 working with Yeoman makes working with angular less hairy and more standard. The AngularJS generator is pretty awesome.
Yesterday I discussed how to create AngularJS animations with CSS3 transitions and what the procedure was for that. So today I am going to talk about the procedure for creating jQuery animations for the AngularJS events. If you are trying to do some more advanced animations, things that require slightly more control than the regular CSS3 transition animations than this is the way to go. Also if you are trying to add animations for older browsers that don't support CSS3 transitions then this is the way to.
If you don't already know it AngularJS has a new directive called ng-animate that provides some very quick and easy animation features. Depending on the associated directives there are some built in events that can trigger animations that you can write very easily using either JavaScript or CSS3 transitions. Today I am going to talk about the animations with CSS3. I'm going to keep it very simple and I hope this clears it up for a lot of people because it was not very clear to me when I got started.
I was working on a Google Maps API version 3 application when I came across this little bug. It is obviously common because this is the second time in about a year and half that I have come across it and each time I have to do a 5 minute Google search for the answer and I always get a little bothered that it might take more than a few minutes to find the answer. I know the last time I looked for the fix for this bug it took a while and I was dreading that again today.
Recently I forked the Joomla Framework because I am working on extending the core to accommodate a REST API more natively. I really love Joomla and how quickly it allows you to be productive. As with any API there is a learning curve and I would not say that Joomla is the Best PHP framework but when it comes to out of the box functionality and CMS's Joomla rocks. Anyways because of the lack of documentation on getting this up and running and because I feel there is a benefit from the community getting involved extending the core I have created this tutorial to guide you. One thing to note though for Windows users the PCNTL extension is not available for windows so you wont be able to run some of the tests. Let's get started with the first steps.
This is part two of my tutorial on MVC with PHP. I'm calling our application Sequoia because I intend to make it big and not keep it too simple. Although right now I am keeping it simple to help those who might just want a taste of how MVC could be implemented with PHP. Again I keep it simple for now omitting Unit Tests and I also purposely omit any checks from the $_GET data because I am just trying to illustrate the pattern rather than create a deployable application. I should also mention that this is one of the many possible ways in which and MVC framework might be implemented. Zend and other frameworks use slightly different approaches but the heart of the matter is still similar.
Lately I have really been digging into the jQuery API's. Particularly regarding jQuery's async functionality and best practices. I have been really intrigued by the promises and $.Deferred API The main reason I was interested in these techniques was because I liked the idea of having code that is less nested and more readable. With JavaScript you easily paint yourself into a corner with nesting issues, but even more so than that there is the issue of code readability. I really appreciate that code is far more legible when you use deferred and promises. In this tutorial I will talk about the deferred object.