angularjs如何实现angular.isString()

这篇文章将为大家详细讲解有关angularjs如何实现angular.isString(),小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<p>`x1`</p>
<p>`x2`</p>
</div>
</body>
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script>
var app = angular.module('myApp',[]);
app.controller('myCtrl',function($scope){
$scope.x1 = "john";
$scope.x2 = angular.isString($scope.x1);
});
</script>
</html>

关于“angularjs如何实现angular.isString()”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。