Sha256: f626a7e9df21507abb171d0a2c8cb45da43442973369cbcbcfe88975999b5723

Contents?: true

Size: 541 Bytes

Versions: 13

Compression:

Stored size: 541 Bytes

Contents

# //= require ./module
class @AngularModel extends Module
  # Automatically registers the controller to the module
  @register: (app, name,type) ->
    name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1]
    app?[type] name, @
  #  Injects dependencies included in args
  @inject: (args...) ->
    @$inject = args

  constructor: (args...) ->
    # Bind injected dependencies on scope ie @$scope
    for key, index in @constructor.$inject || []
      @[key] = args[index]

    # Run initialize function if exists
    @initialize?()

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
material_raingular-0.3.3 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.3.2 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.3.1 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.3.0 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.8.6 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.8.5 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.8 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.7 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.6.3 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.6.2 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.6.1 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.6 lib/assets/javascripts/super_classes/angular_model.coffee
material_raingular-0.2.5 lib/assets/javascripts/super_classes/angular_model.coffee