Why Refactoring Support in a JavaScript IDE Is so Important

image.png

As I’m building out a new version of the Silicon Valley Code Camp web site in AngularJS, I’m running into the very common case where I have not created my program files hierarchy optimally.  What I have now (as seen from JetBrains WebStorm) is the following: I realize now that I’m adding the login screen that I really should have an app folder account and registration should be a subfolder of that.  To make that change without a good tool (like WebStorm), I would need to go into my file manager and copy the files I want, then go into my index.html file and manually change all those directory references.  Likely (because I’m not that good at that kind of work) I’d make at least one mistake and have to come back and revisit … Continue Reading

Angular and ngAnnotate, a Better Way

image.png

I recently posted to StackOverflow a question and example of how adding a dependency injection to my AngularJS app did not seem to matter regarding my program running correctly.  The answer I got back was clear, but somewhat disconcerting.  Basically, the answer is that Angular takes care of the problem for me in development but when I move to production with minification, it will fail.  Well, that sucks on so many levels. Here is an example of code that shows the problem. angular.module('svccApp', []); angular.module('svccApp'). factory('bareService', [ function() { var myValue = {}; myValue.str1 = 'xyz'; return myValue; } ]); angular.module('svccApp') .controller('MyController', … Continue Reading

Using Gulp to Build My JavaScript AngularJS App

Having spent the past few hours learning how Gulp works, and finally customizing it for my scenario, I feel the need to share.  As I was figuring it out, it seems that many have had my thought also.  So, for those not acquainted with Gulp, basically, it's  is a build system of sorts that works with Node.JS. It's got a huge community of tasks that you can use and pipeline together. Basically, here is what my gulpfile.js does: Compiles my SASS (scss) into both expanded and minified CSS Runs jshint on all my JavaScript Concatinates all my JavaScript together and makes both minified and non-minified versions of it Optimizes my images Copies my AngularJS web templates to a production directory Copies my JSON files to a … Continue Reading

ExtJS 5 Bind ViewModel To Template

The simplest things can often be aggravating to get right.  I often find that when something does not work (especially in ExtJS 5 using View Model and Bind) that I need to make the simplest example to prove my understanding to myself.  I thought I would share a very simple yet powerful example of how to bind data from a ViewModel to an xtemplate in ExtJS 5. There are many other things you can do with databinding including modeling selected row in a grid as well as nice integration with formulas.  The below example is just a very simple case that proves it works which is often all I need. Notice that in the code below I’ve created a very simple viewport with just one item.  The two big takeaways are: The data must be … Continue Reading

Follow

Get every new post delivered to your Inbox

Join other followers: