jnizet 6ca6a5e92b fix(@angular/cli): fix doc command to work with new angular.io
- change the URL for the API search
- use google search when --search option is true, since angular.io doesn't have a search page anymore
- improve the help and doc of the doc command
2017-07-19 15:57:15 -04:00

12 lines
374 B
TypeScript

const Task = require('../ember-cli/lib/models/task');
const opn = require('opn');
export const DocTask: any = Task.extend({
run: function(keyword: string, search: boolean) {
const searchUrl = search ? `https://www.google.com/search?q=site%3Aangular.io+${keyword}` :
`https://angular.io/api?query=${keyword}`;
return opn(searchUrl, { wait: false });
}
});