How to use the ember-metal/property_get.get function in ember-metal

To help you get started, we’ve selected a few ember-metal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / ember.js / packages / ember-views / lib / views / select.js View on Github external
value.then(function (resolved) {
        // Ensure that we don't overwrite new value
        if (get(self, 'value') === value) {
          self._setSelectedIndex(resolved);
        }
      });
    } else {
github emberjs / ember.js / packages / ember-routing-views / lib / views / link.js View on Github external
function computeActive(view, routerState) {
  if (get(view, 'loading')) { return false; }

  var currentWhen = get(view, 'current-when');
  var isCurrentWhenSpecified = !!currentWhen;
  currentWhen = currentWhen || get(view, 'targetRouteName');
  currentWhen = currentWhen.split(' ');
  for (var i = 0, len = currentWhen.length; i < len; i++) {
    if (isActiveForRoute(view, currentWhen[i], isCurrentWhenSpecified, routerState)) {
      return get(view, 'activeClass');
    }
  }

  return false;
}
github emberjs / ember.js / packages / ember-views / lib / views / container_view.js View on Github external
_currentViewDidChange: observer('currentView', function() {
    var currentView = get(this, 'currentView');
    if (currentView) {
      Ember.assert("You tried to set a current view that already has a parent. Make sure you don't have multiple outlets in the same view.", !get(currentView, '_parentView'));
      this.pushObject(currentView);
    }
  }),
github emberjs / ember.js / packages / ember-routing-views / lib / views / link.js View on Github external
transitioningOut: computed('active', 'willBeActive', function() {
    var willBeActive = get(this, 'willBeActive');
    if (typeof willBeActive === 'undefined') { return false; }

    return get(this, 'active') && !willBeActive && 'ember-transitioning-out';
  }),
github emberjs / ember.js / packages / ember-views / lib / views / collection_view.js View on Github external
arrayDidChange(content, start, removed, added) {
    var addedViews = [];
    var view, item, idx, len, itemViewClass, itemViewProps;

    len = content ? get(content, 'length') : 0;

    if (len) {
      itemViewProps = this._itemViewProps || {};
      itemViewClass = this.getAttr('itemViewClass') || get(this, 'itemViewClass');

      itemViewClass = readViewFactory(itemViewClass, getOwner(this));

      for (idx = start; idx < start + added; idx++) {
        item = objectAt(content, idx);
        itemViewProps._context = this.keyword ? this.get('context') : item;
        itemViewProps.content = item;
        itemViewProps.contentIndex = idx;

        view = this.createChildView(itemViewClass, itemViewProps);

        addedViews.push(view);
      }

      this.replace(start, 0, addedViews);
    }
github emberjs / ember.js / packages / ember-routing-views / lib / views / link.js View on Github external
if (get(this, '_isDisabled')) { return false; }

    if (get(this, 'loading')) {
      Ember.Logger.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.');
      return false;
    }

    var targetAttribute2 = this.attrs.target;
    if (targetAttribute2 && targetAttribute2 !== '_self') {
      return false;
    }

    var routing = get(this, '_routing');
    var targetRouteName = this._computeRouteNameWithQueryParams(get(this, 'targetRouteName'));
    var models = get(this, 'models');
    var queryParamValues = get(this, 'queryParams.values');
    var shouldReplace = get(this, 'attrs.replace');

    routing.transitionTo(targetRouteName, models, queryParamValues, shouldReplace);
  },
github emberjs / ember.js / packages / ember-views / lib / views / container_view.js View on Github external
forEach(views, function(view) {
      set(view, '_parentView', parentView);

      if (!view.container && parentView) {
        set(view, 'container', parentView.container);
      }

      if (!get(view, 'templateData')) {
        set(view, 'templateData', templateData);
      }
    });
  },
github emberjs / ember.js / packages / ember-routing-views / lib / components / link-to.js View on Github external
loading: computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading() {
    let qualifiedRouteName = get(this, 'qualifiedRouteName');
    let modelsAreLoaded = get(this, '_modelsAreLoaded');

    if (!modelsAreLoaded || qualifiedRouteName == null) {
      return get(this, 'loadingClass');
    }
  }),
github emberjs / ember.js / packages / ember-htmlbars / lib / keywords / real_outlet.js View on Github external
render(renderNode, env, scope, params, hash, template, inverse, visitor) {
    var state = renderNode.state;
    var parentView = env.view;
    var outletState = state.outletState;
    var toRender = outletState.render;
    var namespace = env.container.lookup('application:main');
    var LOG_VIEW_LOOKUPS = get(namespace, 'LOG_VIEW_LOOKUPS');

    var ViewClass = outletState.render.ViewClass;

    if (!state.hasParentOutlet && !ViewClass) {
      ViewClass = env.container.lookupFactory('view:toplevel');
    }

    var options = {
      component: ViewClass,
      self: toRender.controller,
      createOptions: {
        controller: toRender.controller
      }
    };

    template = template || toRender.template && toRender.template.raw;
github emberjs / ember.js / packages / ember-views / lib / views / select.js View on Github external
selection = content ? content.find(function(obj) {
        return value === (valuePath ? get(obj, valuePath) : obj);
      }) : null;