Grunt from the command prompt in Windows

Posted by on May 20, 2015 in JavaScript

If you’re planning to play about with Grunt on Windows any time soon, chances are you’ll find a tutorial online which tells you to install grunt globally as follows: npm install –g grunt 1 npm install –g grunt This will run just fine, but when you next run grunt you’ll get the lovely error: 'grunt' is not recognized as an internal or external command 1 'grunt' is not recognized as an internal or external command Whats going on here then? Turns out Grunt itself is no longer installed globally, but its command line interface (CLI) is. The CLI is simply there as a GLOBAL means of launching a locally provisioned grunt. Therefore all you need to do is amend the command to: npm install –save-dev grunt npm install –g grunt-cli 12 npm install –save-dev gruntnpm install –g grunt-cli that way, the next time you run grunt <anytask> 1 grunt <anytask> from the command line, the CLI will invoke the locally installed grunt instance and you should be good to go. If in doubt, just follow the official grunt.js getting started...

Read More »

Using ng-include in a JADE view

Posted by on Jun 3, 2014 in JavaScript

Referencing angular partials from a jade view I recently ran into a weird problem whereby I couldn’t get a jade template to reference an angular partial using the ng-include directive. I assumed it was as simple as passing in the relative path to the partial view as per: div(ng-include="/partials/featured-courses/") 1 div(ng-include="/partials/featured-courses/") or: div(ng-include='partials/featured-courses') 1 div(ng-include='partials/featured-courses') but this was just completely ignored by Angular – I could see from Firebug that no HTTP request was even being made for this file, so I knew there was some syntax issue here. So I googled it with Bing, as you do, and found this StackOverflow article entitled ‘JADE templating engine does not render ng-include‘. As the answers specify, there’s an odd syntax to getting this working. I followed the guidelines and it worked. The syntax is as folows: div(ng-include='\'partials/featured-courses\'') 1 div(ng-include='\'partials/featured-courses\'') I have no idea why this particular syntax is required – if anyone knows, please feel free to drop me an email and I’ll update the...

Read More »