angular.scope.$get

Work in Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

Returns the value for property_chain on the current scope. Unlike in JavaScript, if there are any undefined intermediary properties, undefined is returned instead of throwing an exception.

         var scope = angular.scope();
         expect(scope.$get('person.name')).toEqual(undefined);
         scope.person = {};
         expect(scope.$get('person.name')).toEqual(undefined);
         scope.person.name = 'misko';
         expect(scope.$get('person.name')).toEqual('misko');
       

Dependencies

Usage

angular.scope.$get(property_chain);

Parameters

Returns

{*}

Value for the (nested) property.