如何使用 AngularJS 控制器进行 Dynamics CRM 开发
How to use AngularJS Controller for Dynamics CRM development
我在我的 CRM 365 中集成了一个 angularjs 应用程序作为网络资源类型 HTML 然后我将 Canuular 控制器添加为网络资源类型 javascript 并将他的依赖项添加到我的html 查看问题是我的控制器没有找到
CRM 中是否有用于 angularjs 开发的特定配置
有我的代码HTML:
<html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-sanitize.js"></script>
<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
**<script src="tit_releveDeCompteurPourTableauDeBordAngularController" type="text/javascript"></script>**
<script src="tit_releveDeCompteurPourTableauDeBordAnularService" type="text/javascript"></script>
<title>titleTest</title>
</head>
<body ng-controller="TestController">
<div class="container" style="font-family: undefined;">
<h1>xxxxxxxxx</h1>
</div>
</body></html>
我的控制器如下所示:
var app = angular.module('demoApp', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']);
app.controller('TestController',['$scope', 'serviceFactory', function ($scope, serviceFactory) {
debugger;
alert("TestController");
$scope.name = "nametest";
}]);
您尚未在 html 中定义 ng-app。
请将 ng-app 添加到您的正文或 div 或...像这样:
<body ng-app="ngAppDemo">
ng-app 告诉 angular 它应该在您页面上的哪个位置处于活动状态。
我在我的 CRM 365 中集成了一个 angularjs 应用程序作为网络资源类型 HTML 然后我将 Canuular 控制器添加为网络资源类型 javascript 并将他的依赖项添加到我的html 查看问题是我的控制器没有找到 CRM 中是否有用于 angularjs 开发的特定配置
有我的代码HTML:
<html><head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-animate.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular-sanitize.js"></script>
<script src="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
**<script src="tit_releveDeCompteurPourTableauDeBordAngularController" type="text/javascript"></script>**
<script src="tit_releveDeCompteurPourTableauDeBordAnularService" type="text/javascript"></script>
<title>titleTest</title>
</head>
<body ng-controller="TestController">
<div class="container" style="font-family: undefined;">
<h1>xxxxxxxxx</h1>
</div>
</body></html>
我的控制器如下所示:
var app = angular.module('demoApp', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']);
app.controller('TestController',['$scope', 'serviceFactory', function ($scope, serviceFactory) {
debugger;
alert("TestController");
$scope.name = "nametest";
}]);
您尚未在 html 中定义 ng-app。 请将 ng-app 添加到您的正文或 div 或...像这样:
<body ng-app="ngAppDemo">
ng-app 告诉 angular 它应该在您页面上的哪个位置处于活动状态。