0

I'm using OSX 10.10, Webstorm 10.0.4, AngularJS 1.4.3

For example:

.factory('huodai.order.BatchPlanModel', function () {
        var BatchPlanModel = function (date, batches) {
            date = date || "";
            batches = batches || {};
            this.date = date;
            this.batches = batches;
        };
        return BatchPlanModel;
    })

I want when I type var a = new BatchPlanModel() in the controller, some hint about the parameter or documentation shows up. But what did shows up when I press F1 is the definition of the controller. Like:

        ($filter,
         [ optional ] $scope,
         [ optional ] $state,
         $timeout,
         BatchPlanModel,
         BatchPlanFactory,
         EXAMINATION,
         ARRIVE_TYPE )

Parameters:
$filter
$scope
$state
$timeout
BatchPlanModel
BatchPlanFactory

And adding something like

       /**
         * 
         * @param date
         * @param batches
         * @constructor
         */

before the var BatchPlanModel = ... was no help.

addlistener
  • 871
  • 1
  • 12
  • 20
  • 1
    In PHP Storm I only see the documentation when adding `@param {ClassName}` for each injected service. Even the inline `@type` doesn't seem to give the proper documentation. – Chris Aug 13 '15 at 13:36

2 Answers2

0

Try changing your component declarations to use declared function references rather than anonymous functions

.factory('huodai.order.BatchPlanModel', batchPlanFactory)

function batchPlanFactory(){
  var BatchPlanModel = function (date, batches) {
            date = date || "";
            batches = batches || {};
            this.date = date;
            this.batches = batches;
        };
        return BatchPlanModel;
}
charlietfl
  • 170,828
  • 13
  • 121
  • 150
  • Tried but with no luck. Though I like the way you think about it. It appears WebStorm tends to refer to all the method functions with the same name when your lookup a method function reference. – addlistener Aug 13 '15 at 15:17
0

Somehow I can check parameter info not by showing the documentation(pressing F1). There's a Paramter Info section in Preferences. You can set the Autopopup time shorter so you will be notified with the parameter info more quickly.

addlistener
  • 871
  • 1
  • 12
  • 20