小编Raj*_*mar的帖子

AngularJS控制器错误 - :$ http.get不是控制器部分中的函数

var hsbc = angular.module('hsbc',['ngResource','ngRoute']);
Run Code Online (Sandbox Code Playgroud)

hsbc.config(['$ routeProvider','$ locationProvider',function($ routeProvider,$ locationProvider){

//console.log('config part working'); 
$routeProvider
    .when('/login', {
        controller: 'hsbccontroller',
        templateUrl: 'modules/authentication/views/login.html',
        hideMenus: true
    })
    .when('/gloabltranfer', {
        controller: 'hsbccontroller',
        templateUrl: 'modules/home/views/gloabltranfer.html'
    })
    .when('/tranferReq', {
        controller: 'hsbccontroller',
        templateUrl: 'modules/home/views/TransferRquest.html'
    })
    .when('/reviewdetail', {
        controller: 'hsbccontroller',
        templateUrl: 'modules/home/views/Reviewdetails.html'
    })
    .when('/confirmdetail', {
        controller: 'hsbccontroller',
        templateUrl: 'modules/home/views/confirmdetails.html'
    })

    .when('/', {
        controller: 'hsbccontroller',
        templateUrl: 'modules/authentication/views/login.html'
    })

    .otherwise({ redirectTo: '/login' });
Run Code Online (Sandbox Code Playgroud)

}]).controller('hsbccontroller',['$ scope','$ http','$ resource',function($ scope,$ resource,$ http){

    //console.log('controller part working'); 
$http.get('http://localhost:8080/1/').success(function(data) {
    alert(data);
        $scope.greeting = data;
    });
Run Code Online (Sandbox Code Playgroud)

}]);

javascript restful-url angularjs ngresource

7
推荐指数
1
解决办法
2万
查看次数

如何获取和设置 div.class 高度

请建议我以任何方式获取和更新打字稿中 HTML 元素的高度。

document.getElementsByClassName('height').style.height = childHeight;
Run Code Online (Sandbox Code Playgroud)

不管用。我得到

类型“HtmlCollectionOf<Element>”上不存在属性“style”

typescript typescript2.0

6
推荐指数
1
解决办法
7711
查看次数