0

MVC ウェブフォーム ビュー ページで使用したい AngularJS コントローラーがあります。

簡単なコードを作成しましたが、動作しないようです。

Test.js

angular.module('project').controller("TestCtrl", function($scope){
  $scope.text = 'test';
});

View.aspx

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<SampleProject.Models.ReportInfo>" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" ng-app="project">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" ng-controller="TestCtrl">
        {{text}}
    </form>
</body>
</html>

testという単語が表示されることを期待していますが、バインドされません。{{text}}しか見えない

4

1 に答える 1