Installing and Configuring Bower
Bower is a NodeJs package, and therefore can be installed from the command line once NodeJs has been installed:
npm install -g bower
It's crucial to include the
-g
flag here so that it is available to you from any location. Each time you create a new project you're potentially going to be using Bower to install some if not all of your assets.Installing AngularJs
The syntax for installing any package with Bower is:bower install <package>
This has to be run from the command line in the directory that you want the package to be delivered to, typically the root of your site. To install AngularJs:
bower install angular
In my post about client side routing with ui-router I used Bower to install the code for that too:
bower install angular-ui-router
There are lots of cool codebases available through Bower. You can search packages on Bower here.
Benefits within WebStorm
The biggest benefit to me as a developer doing this was a completely unexpected one. Now that WebStorm can see a suite of files it knows about the functions contained within AngularJs and can provide auto-complete and suggestion prompts for me as I'm programming. This is just fantastic, and makes my life so much easier. I can't imagine not using AngularJs in this way now, and get frustrated when I'm at work and don't have this ability.Auto complete whilst creating a module:
Auto complete whilst creating a controller:
To autocomplete from these stages you can use tab or ctrl+space in Windows, or ^+space on Mac.
No comments:
Post a Comment