ng:areq Argument'AppDetailsCtrl'不是函数,未定义

时间:2017-03-10 14:12:14

标签: angularjs controller coffeescript

我正在尝试将我的咖啡脚本文件链接到相应的控制器,但是我收到以下错误:

Error: [ng:areq] Argument 'AppDetailsCtrl' is not a function, got undefined
http://errors.angularjs.org/1.4.14/ng/areq?

首先,我需要点击一个按钮来创建一个新的应用程序。

这是html:

<button id="create-new-app" ng-click="createApp()"/>

当我点击按钮时,我需要它来触发模态对话框。

这是我的咖啡脚本文件:

$scope.createApp = ->
    $uibModal.open
        templateUrl: 'views/admin/app.html'
        controller: 'AppDetailsCtrl'
        windowClass: 'lg'
        resolve:
            app: ->
                null
            platforms: ->
                $scope.Platforms
            languages: ->
                $scope.Languages
    .result.then (newApp) ->
        console.log "create app #{newApp.Name}"
        $scope.creatingObject.App = true
        payload = angular.copy(newApp)
        $http.put(
            "#{$config.serverAddress}AppStoreAdmin/CreateApp"
            payload
        )

这是我的角度控制器app.coffee:

'use strict'

angular.module('app.controllers')
.controller 'AppDetailsCtrl', (
$scope
$uibModalInstance
store
platforms
languages
) ->

$scope.languages = languages
$scope.platforms = platforms.map (platform) ->
    ID: platform.ID
    Name: platform.Name

if app
    $scope.title = "Edit App"
    $scope.app = app
    $scope.app.AppstorePlatform = $scope.app.AppstorePlatform.ID
else
    $scope.title = "Create App"
    $scope.app = {
        AppstoreStoreLanguages: []
        AppstoreFields: []
    }

我在这里看不到什么?任何帮助非常感谢。

提前致谢。

0 个答案:

没有答案