Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 检测应用程序是否通过SSL访问?_Angularjs_Ssl - Fatal编程技术网

Angularjs 检测应用程序是否通过SSL访问?

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

如果应用程序是通过https访问的,是否有方法检测角度?我需要检测,以便正确的url被构造并传递到$http服务中,传递
http
将生成
“内容必须通过HTTPS提供”。
错误。

您可以使用该服务访问封装的窗口对象:

if( $window.location.protocol == "https" )
{
     // whatever
}
您可以使用该服务访问封装的窗口对象:

if( $window.location.protocol == "https" )
{
     // whatever
}