AngularJs在渲染页面中出现问题

时间:2016-02-02 06:56:48

标签: angularjs

所有符号(。,)在json的角度数据绑定中显示为问题mar请帮我修复此问题this is the json file preview in browser

    //html
< p ng - bind - html = "servicesDetails[WhichItem].descriptions" > < /p>

//controller

var MaalimServicesData = angular.module('MaalimServicesData', ["ngSanitize"]);
MaalimServicesData.controller('MaalimServicesController', ['$scope', '$http', function($scope, $http) {
    $http.get('views/services.json').success(function(data) {
        $scope.servicesDetails = data;
    });
}]);


MaalimServicesData.controller('MaalimRoutecontroller', ['$scope', '$http', '$routeParams', function($scope, $http, $routeParams) {
    $http.get('views/services.json').success(function(data) {
        $scope.servicesDetails = data;
        $scope.WhichItem = $routeParams.itemId;
    });
}]);

//app.js

var Maalim_web = angular.module('Maalim_web', ['ngRoute', 'MaalimServicesData']);

Maalim_web.config(['$routeProvider',
    function($routeProvider) {
        $routeProvider.
        when('/services', {
            templateUrl: 'views/services.html',
            controller: 'MaalimServicesController'
        }).
        when('/details/:itemId', {
            templateUrl: 'views/more.html',
            controller: 'MaalimRoutecontroller'
        }).
        otherwise({
            redirectTo: '/services'
        });
    }
]);

//route for peoples

Maalim_web.config(['$routeProvider', function($routeProvider) {
    $routeProvider.
    when('/peoples', {
        templateUrl: 'views/people.html',
        controller: 'MaalimpeopleDataController'
    }).
    when('/people_details/:itemId', {
        templateUrl: 'views/people_details.html',
        controller: 'MaalimPeopleRouteController'
    }).
    otherwise({
        redirectTo: '/peoples'
    });
}]);

我在角度方面非常新。请帮助我解决此问题,请参阅图片以获取更多信息。

0 个答案:

没有答案