Angularjs ng开关未按预期切换

Angularjs ng开关未按预期切换,angularjs,Angularjs,对于ng开关,我似乎缺少一些基本的东西。这是一本书 我正试图打开profile\u type,但无法打开 <div ng-controller="MyCtrl"> <div ng-repeat="result in results"> <div ng-switch="profile_type"> <div ng-switch-when="PatientProfile">{{ result.name }

对于
ng开关
,我似乎缺少一些基本的东西。这是一本书

我正试图打开
profile\u type
,但无法打开

<div ng-controller="MyCtrl">
    <div ng-repeat="result in results">
        <div ng-switch="profile_type">
            <div ng-switch-when="PatientProfile">{{ result.name }}</div>
            <div ng-switch-when="DoctorProfile">{{ result.name }}</div>
        </div>
    </div
</div>

$scope.results = [
    {profile_type: "PatientProfile", name: "Steve Patient"},
    {profile_type: "DoctorProfile", name: "Joe Doctor"},
]

{{result.name}
{{result.name}

缺少某些内容,请找到此行并按如下方式更改:

<div ng-switch="result.profile_type">