Giter VIP home page Giter VIP logo

aurelia-repeat-strategies's People

Contributors

alvarezmario avatar martingust avatar nicmendoza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aurelia-repeat-strategies's Issues

Can't load with webpack (Can this be added to npm?)

I'd like to use this on a modern project (Aurelia CLI/Webpack), but the readme instructions are still for jspm.

I tried installing via

yarn add github:martingust/aurelia-repeat-strategies

which technically worked, and registered it (as stated in the readme, but using PLATFORM.moduleName since I'm using Webpack) with

.plugin(PLATFORM.moduleName('martingust/aurelia-repeat-strategies'))

but when I run it I get:

webpack-dev-server.js:1 ./src/main.ts
Module not found: Error: Can't resolve 'martingust/aurelia-repeat-strategies' in ...

If I try removing martingust/ and use

.plugin(PLATFORM.moduleName('aurelia-repeat-strategies'))

then I get

Error: Unable to find module with ID: martingust/aurelia-repeat-strategies
    at WebpackLoader.<anonymous> (aurelia-loader-webpack.js:197)
    at step (aurelia-loader-webpack.js:41)
    at Object.next (aurelia-loader-webpack.js:22)
    at aurelia-loader-webpack.js:16
    at new Promise (<anonymous>)
    at push../node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js.__awaiter (aurelia-loader-webpack.js:12)
    at WebpackLoader.push../node_modules/aurelia-loader-webpack/dist/native-modules/aurelia-loader-webpack.js.WebpackLoader._import (aurelia-loader-webpack.js:162)
    at WebpackLoader.<anonymous> (aurelia-loader-webpack.js:262)
    at step (aurelia-loader-webpack.js:41)
    at Object.next (aurelia-loader-webpack.js:22)

error while installing this package with JSPM as instruction)

warn Running jspm globally, it is advisable to locally install jspm via npm inst
all jspm --save-dev.
Looking up github:martingust/aurelia-repeat-strategies

warn Error on lookup for github:martingust/aurelia-repeat-strategies, retrying (
1).
Error: fatal: unable to access 'martingust/aurelia-repeat-strategies.git/':
Received HTTP code 407 from proxy after CONNECT

warn Error on lookup for github:martingust/aurelia-repeat-strategies, retrying (
2).
Error: fatal: unable to access 'martingust/aurelia-repeat-strategies.git/':
Received HTTP code 407 from proxy after CONNECT

warn Error on lookup for github:martingust/aurelia-repeat-strategies, retrying (
3).
Error: fatal: unable to access 'martingust/aurelia-repeat-strategies.git/':
Received HTTP code 407 from proxy after CONNECT

warn Error on lookup for github:martingust/aurelia-repeat-strategies
Error: fatal: unable to access 'martingust/aurelia-repeat-strategies.git/':
Received HTTP code 407 from proxy after CONNECT

err Error looking up github:martingust/aurelia-repeat-strategies.

warn Installation changes not saved.

Error when used with webpack skeleton

When using this plugin in aurelia-skeleton-typescript-webpack the build script produces the following error:

ERROR in ./~/aurelia-repeat-strategies/dist/commonjs/index.js Module not found: Error: Cannot resolve module 'aurelia-templating-resources/repeat-strategy-locator' in C:\Development\node_modules\aurelia-repeat- @ ./~/aurelia-repeat-strategies/dist/commonjs/index.js 8:55-118

ERROR in ./~/aurelia-repeat-strategies/dist/commonjs/iterable-repeat-strategy.js Module not found: Error: Cannot resolve module 'aurelia-templating-resources/repeat-utilities' in C:\Development\node_modules\aurelia-repeat-strateg @ ./~/aurelia-repeat-strategies/dist/commonjs/iterable-repeat-strategy.js 13:49-105

Updating bound viewmodel property does not cause the rendered DOM fragment to be replaced, but appended to

If we take your example view/viewmodel pair, and extend it just a tiny bit to allow a contrived example where we update the bound property, as below, the issue is simple to replicate.

viewmodel

export class App {
  data = {
    "foo": {
      baz: true
    },
    "bar": {
      baz: false
    }
  }

  update(){
    this.data = {
      "foo": {
        baz: false
      },
      "bar": {
        baz: true
      }
    };
  }
}

view

<template>
  <div repeat.for="[key, value] of data | iterable">
    ${key} ${value.baz}
  </div>
  <button class="button" click.trigger="update()">update</button>
</template>

Here you can see a screenshot of the behavior after the button is pressed. Subsequent presses cause the same effect, with additional DOM fragments being appended, rather than replacing the original markup.

image

Similarly, setting the viewmodel property to undefined has no effect whatsoever (you would expect it to clear out the relevant section of DOM, but instead the DOM fragment remains in place).

Let me know if I can add any further information. I thought I'd start with a bug report, since I am not yet familiar with the internals of Aurelia.

JSPM: not found

Found via aurelia/templating-resources#41

Really hoping this works. I tried installing via jspm as described in the readme but I get the error "Repo jspm:martingust/aurelia-repeat-strategies not found.". I ended up installing like this instead
jspm install github:martingust/aurelia-repeat-strategies

nested object iteration "Reflect.ownKeys on non-object"

data

Object {
  06-23-2016: {
    "20:30 -04:00": {
        "itemkey": { attr1:val1, attr2:val2, etc }
    },
   "anothertime": {
       "itemkey":{attr1:val1, etc},
       etc
    }
  }, 
  06-24-2016: etc, 
  06-25-2016: etc, 
  06-27-2016: etc, 
  07-01-2016: etc
}

view.jade

      h2 Firebase Listing Actual
      ul
        li(repeat.for="[date,times] of listObj | iterable")
          |${a} ${times}  // this works, shows value for ${a} and [object Object] for ${times}
          ul
            li(repeat.for="[a,b] of times | iterable")
              |${a} ${b}  // fails, Reflect.ownKeys on non-object

view.ts

  listObj=[];

  attached(){
    let ref = firebase.database().ref('events');

    ref.on('value', events => {
      this.listObj = events.val();
    });
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.