0
私は角度が新しく、手を入れています。私は角度が私のコントローラを見つけることができないという問題に立ち往生した。ここにplunkrへの私のリンクがあります。 http://plnkr.co/edit/D1S0UBha7Dil6gLQNx0w?p=preview。助けを探しています。角度のエラー、VM1973 angular.js:11655エラー:[ng:areq]引数 'NewsPostListCtrl'が関数ではない、定義されていません
ctrl.js
(function() {
"use strict";
angular.module("newspostmodule").controller("NewsPostListCtrl", NewsPostListCtrl);
function NewsPostListCtrl() {
var newsPostm = this;
newsPostm.newsposts = [
{
"heading": "header",
"author": "author",
"postDate": "postDate",
"comment": "comment",
"like": 2
},
{
"heading": "header1",
"author": "author1",
"postDate": "postDate1",
"comment": "comment1",
"like": 10
}]
}
});
驚くばかりです。ありがとうございました..なぜ変数を使用せずに自分のコードで動作していなかったのか説明してください。 – Pankaj
ああ..私は問題がある。私は最後に '()'で関数を実行していませんでした。 – Pankaj