Skip to content

function-type on a string constant #549

@lapo-luchini

Description

@lapo-luchini
var server = () ? 'http://test/' : 'http://production/';
angular.module('myMod', []).constant('server', server);

gives me a Use anonymous functions instead of named function angular/function-type.

I tried with:

angular.module('myMod', []).constant('server', function () {
    return () ? 'http://test/' : 'http://production/';
});

but that returns the literal function, not the value.

What's the suggested approach here?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions