Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 09:28
    pasinduperera synchronize #1514
  • 09:20
    pasinduperera synchronize #1514
  • 09:11
    pasinduperera opened #1514
  • Oct 02 22:01
    kaiyoma opened #1513
  • Sep 30 20:20
    jfellus edited #1512
  • Sep 30 20:20
    jfellus edited #1512
  • Sep 30 20:19
    jfellus edited #1512
  • Sep 30 20:18
    jfellus edited #1512
  • Sep 30 20:18
    jfellus edited #1512
  • Sep 30 20:17
    jfellus opened #1512
  • Sep 21 09:57
    arcanis opened #1511
  • Sep 20 16:18
    reduxdj edited #1510
  • Sep 20 16:18
    reduxdj opened #1510
  • Sep 20 08:28
    mininek opened #1509
  • Aug 15 17:06
    chaffeqa opened #1508
  • Aug 08 16:07
    lierdakil closed #1507
  • Aug 08 16:07
    lierdakil labeled #1507
  • Aug 08 11:43
    rahamin1 opened #1507
  • Aug 07 12:07
    lierdakil labeled #1505
  • Aug 07 12:07
    lierdakil closed #1505
Nelo Mitranim
@Mitranim

It's convenient to have base viewmodel methods to shorter data sync declaration. For example:

constructor() {
  super()

  this.sync({
    langVal: this.lang,
    wordsVal: this.words
  })
}

Would be equivalent to:

constructor() {
  super()

  this.lang.on('value', snap => {
    this.langVal = snap.val()
  })
  this.words.on('value', snap => {
    this.wordsVal = snap.val()
  })
}
And when using Fireproof, you can $q.all the first complete sync
It's also easy to make directives to three-way-sync data on inputs
kpgarrod
@kpgarrod
@mitranim thank. I have a big bunch of AngularFire models (70-ish) and I'm quite happy with the way they work apart from type-checking. If I could fix the angularFire typedefs to be generic I would be smiling!
Nelo Mitranim
@Mitranim
Oh nice to hear it works for you
kpgarrod
@kpgarrod
thanks for the tip about fireproof. I also use native Firebase in some places and usually wrap it in my own $q resolve/reject. Fireproof could save me a few lines of code!
Nelo Mitranim
@Mitranim
If you're using ES6 modules and run your code outside angular factories, you might have to do angular.injector(['ng']).get('$q') initially to bless Fireproof, then re-bless it with an instance of $q from your application's injector after the application bootstrap
De Lille Felix
@flieks

@Mitranim I puted <reference paths in a tsconfig.json in the /src folder but it's not picked up in a ts file
the code

/// <reference path="../typings/aurelia/aurelia-framework.d.ts" />
/// <reference path="../typings/breeze/breeze.d.ts" />
/// <reference path="../typings/aurelia/aurelia-http-client.d.ts" />
/// <reference path="../typings/aurelia/aurelia-router.d.ts" />
/// <reference path="../typings/es6-promise/es6-promise.d.ts" />

{

    "version": "1.5.0",
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "noImplicitAny": false
    }

}

So then in a ts file (without any references) with a Promise type it fails now (it succeeded before)

Nelo Mitranim
@Mitranim
Huh no that's not what I meant :D
If no "files" property is present in a tsconfig.json, the compiler defaults to including
all files in the containing directory and subdirectories. When a "files" property is
specified, only those files are included.
De Lille Felix
@flieks
yes, but the typings folder is one folder up in the chain
Nelo Mitranim
@Mitranim
Yeah that's why I suggested you move it inside the project
Most painless setup ever
no ///reference, no extra paths for the compiler, no files, nothing
De Lille Felix
@flieks
so 1 up
Nelo Mitranim
@Mitranim
./═╦═ dist
   ╚═ src
      ╚═ app
         ╠═ typings
         ╠═ stuff
         ╚═ utils
De Lille Felix
@flieks
ok what other folder are there in the app folder ?
Nelo Mitranim
@Mitranim
echo "src/app/typings" >> .gitignore
De Lille Felix
@flieks
i only had app.ts in there
and the navbar
Nelo Mitranim
@Mitranim
tsd.json:
  "path": "src/app/typings",
  "bundle": "src/app/typings/tsd.d.ts",
De Lille Felix
@flieks
i don't have a tsd.json
Nelo Mitranim
@Mitranim
Then you're downloading typings by hand?
De Lille Felix
@flieks
yes
Nelo Mitranim
@Mitranim
npm i -g tsd
tsd init, then make the change I suggested
and run
tsd install <your dependencies> -r -s
except I'm not sure your dependencies actually exist on tsd, but you should set this up anyway
also run npm i tsd --save-dev so that it's always included with the project
also makes sense to add tsd update to postinstall in package.json -> scripts
Jonathan Park
@park9140
tsd query <dependecy> --action install —save << pre 0.6 in case anyone reads this without the line below
Nelo Mitranim
@Mitranim
@park9140 that's pre-0.6
Jonathan Park
@park9140
wait
0.6 came out
!
De Lille Felix
@flieks
tsd.json also put in /src folder ?
Nelo Mitranim
@Mitranim
yep so you can use the new syntax I listed
Nah tsd.json can live in root
You run most CLI commands from the root so tsd.json needs to be there
De Lille Felix
@flieks
ok this is my tsd at the root:
{
  "version": "v4",
  "repo": "borisyankov/DefinitelyTyped",
  "ref": "master",
  "path": "src/app/typings",
  "bundle": "src/app/typings/tsd.d.ts",
  "installed": {}
}
This message was deleted
Nelo Mitranim
@Mitranim
yesh looks good
De Lille Felix
@flieks
i did
tsd install aurelia-framework -r-s
Nelo Mitranim
@Mitranim
if you run tsd install lodash -s, it'll install its typings into src/app/typings and save to tsd.json
De Lille Felix
@flieks
it said zero result
Nelo Mitranim
@Mitranim
yeah that's because aurelia is not on tsd, as I just discovered
unfortunate