简体   繁体   中英

How to use AngularJS Controller for Dynamics CRM development

I integrate an angularjs app in my CRM 365 as a web ressource type HTML then i add the Canuular controller as a web ressource type javascript and add his dependency in my html view the issue is that my controller isn't loded is there a specifiq configuration in CRM for angularjs developpment

there is my code 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>

and my controller is like bellow :

var app = angular.module('demoApp', ['ngAnimate', 'ngSanitize', 'ui.bootstrap']);
app.controller('TestController',['$scope', 'serviceFactory', function ($scope, serviceFactory) {
debugger;
alert("TestController");
    $scope.name = "nametest";

}]);

You have not defined an ng-app in your html. Please add ng-app to your body or div or ... like this:

 <body ng-app="ngAppDemo">

ng-app tells angular where it should be active on your page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM