2016-01-17 35 views
0

我是編程的初學者。我想了解這個角度函數的開始是逐行進行的嗎?Angularjs函數含義

function UserProfileService($http, ApiConfigService) { 
    var profileUrl = ApiConfigService.getEndpoints().user_service + 
'/v2/users/profile'; 
    var oauthUrl = ApiConfigService.getEndpoints().oauth_service + 
'/v2/oauth'; 

謝謝!

回答

0

它創建兩個不同的字符串變量。基礎url來自ApiConfigService,其餘的連接到baseurl。

我們可以假設如下: ApiConfigService.getEndpoints().user_service = 'http://example.com/user-service' ApiConfigService.getEndpoints().oauth_service = 'http://example.com/oauth-service'

那麼這裏的變量會得到以下值: profileUrl = 'http://example.com/user-service/v2/users/profile' oauthUrl = 'http://example.com/oauth-service/v2/oauth'