Angular和ngTagsInput - 无法读取未定义的属性“数据”

时间:2017-05-16 16:12:57

标签: angularjs ng-tags-input

每次输入3个字符时,我都无法完成这项工作:

Public Function GetIsoTimestampTest() As String
Dim st As SYSTEMTIME

'Get the local date and time
GetSystemTime st

'Format the result
GetIsoTimestampTest = _
    Format$(st.wYear, "0000") & "-" & _
    Format$(st.wMonth, "00") & "-" & _
    Format$(st.wDay, "00") & "T" & _
    Format$(st.wHour, "00") & ":" & _
    Format$(st.wMinute, "00") & ":" & _
    Format$(st.wSecond, "00") & "Z"
End Function

这是在我的控制器中:

TypeError: Cannot read property 'data' of undefined
    at core.min.js?v=1494950519:37874
    at processQueue (core.min.js?v=1494950519:14634)
    at core.min.js?v=1494950519:14650
    at Scope.$eval (core.min.js?v=1494950519:15916)
    at Scope.$digest (core.min.js?v=1494950519:15727)
    at Scope.$apply (core.min.js?v=1494950519:16024)
    at core.min.js?v=1494950519:17791
    at completeOutstandingRequest (core.min.js?v=1494950519:5490)
    at core.min.js?v=1494950519:5762

这是我的html:

 $scope.loadItems = function (query) {
        var defer = $q.defer();
        defer.resolve([
            { text: 'just' },
            { text: 'some' },
            { text: 'cool' },
            { text: 'tags' }
        ]);
        return defer.promise;
    };

无法想出什么是错的,有什么想法吗? 如果我删除<tags-input ng-model="tags"> <auto-complete source="loadItems($query)"></auto-complete> </tags-input> ,则可以使用。

0 个答案:

没有答案