AngularJs Ng-Repeat访问数组中的数组(没有嵌套的ng-repeat)

时间:2015-09-13 21:58:16

标签: arrays angularjs

我想访问数组中数组内的数据,而不使用嵌套的ng-repeats,因为当我这样做时,它会显示我想要多次显示的内容。我想做一个ng-repeat,只对我内部大多数数组中的数据进行循环,同时仍然知道它所包含的外部数据的数据,以便在用户点击时改变它。这是我的代码:

HTML

Canvas

JAVASCRIPT:

    private void animateMarker() {
    if (mCamera == null) {
        mCamera = new Camera();
    }

    ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
    animator.setDuration(300);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
//              float interpolatedTime = ((Float) (animation.getAnimatedValue())).floatValue();
//              final double radians = Math.PI * interpolatedTime;
//              float degrees = (float) (180.0 * radians / Math.PI);
                final Matrix matrix = new Matrix();

//              mCamera.translate(0.0f, 0.0f, (float) (150.0 * Math.sin(radians)));
//              mCamera.rotateX(degrees);
//              mCamera.rotateY(degrees);
//              mCamera.rotateZ(degrees);
//              mCamera.getMatrix(matrix);

                Resources resources = mContext.getResources();
                Drawable drawable = resources.getDrawable(R.drawable.custom_pin);
                Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),
                    Bitmap.Config.ARGB_8888);
                Canvas canvas = new Canvas(bitmap);
//              mCamera.applyToCanvas(canvas);
//              canvas.setMatrix(matrix);
//              drawable.draw(canvas);
                canvas.drawBitmap(bitmap, matrix, null);
                mMarkerSetLocation.setIcon(mBitmapDescriptorFactory.fromBitmap(bitmap));
        }
    });
    animator.start();
}

所以从本质上讲,我想这样做,当我点击产品数组的一个元素时,我只能在ng-repeat中显示该被点击的产品数组的jobs数组中的信息。

0 个答案:

没有答案