Skip to content

AngularJS -CoffeeScript factory #84

@yuryodin

Description

@yuryodin

https://github.com/Plateful/plateful-mobile/wiki/AngularJS-CoffeeScript-Style-Guide#factories
in right example

### recommended ###
(->
  dataService = ()->

    someValue = ''

    ##########

    return
      save: ()->
       # . #

      validate: ()->
       # . #
  angular
    .module('app')
    .service('dataService', dataService)
)()

Coffescript compiler shows SyntaxError 'unexpected indentation' at return line
What's wrong with that?And why topic called factories and we create "service" ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions