0
$ inject 주석을 내 Typescript 클래스에서 작동 시키려고하는데 항상 정의되지 않은 것 같습니다. 누구든지 내가 뭘 잘못하고 있다고 제안 할 수 있습니까? 그것은 작동
app.controller('AuthenticationControl', [ '$window', Picasa.PicasaAuthenticator ]);
을 : 나는 $의 분사 주석을 제거하고이에 내 컨트롤러 생성을 변경하는 경우
export class PicasaAuthenticator {
static $inject = [ '$window' ];
constructor(private $window : ng.IWindowService)
{
}
public startAuthentication()
{
var authUrl:string = "https://accounts.google.com/o/oauth2/auth";
authUrl += "?client_id=" + client_id;
authUrl += "&response_type=token";
authUrl += "&scope=https://picasaweb.google.com/data/";
authUrl += "&redirect_uri=" + window.location;
if (this.$window)
{
this.$window.location.assign(authUrl);
}
else
{
alert("nav: " + authUrl);
}
}
}
app.controller('AuthenticationControl', [ Picasa.PicasaAuthenticator ]);
.
는
많은 감사 당신의 사용과 정적 $inject
속성에 제공 사출 인수를 무시되기 때문이다
아하! 나는 많이 깔끔한 것을 본다! 그래서 원래의 버전에서 Inject 배열은 컨트롤러에서 다시 정의했을 때 무시되었습니다. 많은 감사. – Roaders
@Roaders 예 맞습니다 .. 당신은 .. 오신 것을 환영합니다 .. :) – PSL