Angularjs 检测应用程序是否通过SSL访问?
如果应用程序是通过https访问的,是否有方法检测角度?我需要检测,以便正确的url被构造并传递到$http服务中,传递Angularjs 检测应用程序是否通过SSL访问?,angularjs,ssl,Angularjs,Ssl,如果应用程序是通过https访问的,是否有方法检测角度?我需要检测,以便正确的url被构造并传递到$http服务中,传递http将生成“内容必须通过HTTPS提供”。错误。您可以使用该服务访问封装的窗口对象: if( $window.location.protocol == "https" ) { // whatever } 您可以使用该服务访问封装的窗口对象: if( $window.location.protocol == "https" ) { // whatever
http
将生成“内容必须通过HTTPS提供”。
错误。您可以使用该服务访问封装的窗口对象:
if( $window.location.protocol == "https" )
{
// whatever
}
您可以使用该服务访问封装的窗口对象:
if( $window.location.protocol == "https" )
{
// whatever
}