Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Brandon
@brandonroberts
@robinjoseph08 Hmm. Can you reproduce in a plunker? Or share your route config?
@robinjoseph08 Do you have the router directives included in your child component directives?
Ken Rimple
@krimple
@jamespacileo I know, right? He's about 22, so I want so badly to call him sparky, but man he's so smart. I remember when I used to be bright eyed like that! Anyway, he was the guy who implemented the web worker code too. Looking forward to more videos by him.
Robin Joseph
@robinjoseph08
@brandonroberts ill try to get a plunker up. and yeah, I have directives: [RouterLink] in my child component
Daniel
@gaiottino
@ericmartinezr hmm. I'm not convinced. It feels very strange that Angular would or should pickup listeners from other libs. It doesn't seem to be that that is quite the case either. Because if I add it to a script-tag in index.html then it's not picked up. I tried adding it to a setTimeout but that still caused many many updates in Angular :-/
Brandon
@brandonroberts
@krimple do you have the router bundle included in your scripts?
Ken Rimple
@krimple
@brandonroberts yes... I am trying to get a plnkr together on it too, just to check my work.
Daniel
@gaiottino
Basically I want to catch if the DOM inside an ng-content tag has changed. How would I go about doing that?
Ken Rimple
@krimple
And it was working fine before, so something borked it. Just not sure what.
Brandon
@brandonroberts
@krimple remove Router from your bindings in the blogroll.ts
You don’t need it there
Ken Rimple
@krimple
oh dang, that's probably it.
oh, actually - I was injecting it in the constructor so I could chnage the route when I finished editing...
so if I am using a service, don't I need to add it as a binding in the component I'm injecting it into?
Brandon
@brandonroberts
Naa .. Since router providers is in your bootstrap you don’t need to add it as a binding
Its available to be injected anywhere
Ken Rimple
@krimple
btw that did it, @brandonroberts
Brandon
@brandonroberts
:+1:
Ken Rimple
@krimple
So, me dumb... ROUTER_PROVIDERS basically included the Router service?
coolio!
Brandon
@brandonroberts
Yep
Ken Rimple
@krimple
ok, many thanks, I knew it was dumb.
Brandon Angelakos
@bangelakos
Does anyone know when the additional parts of the official Angular.io tutorials will be complete?
Chad Autry
@chad-autry
Anyone else have issues where their app works fine on Chrome, but just won't work in Firefox (no error I can see) or IE (" ` " is an invalid character)
James Pacileo
@jamespacileo
@krimple 22! Glad Angular team is full of bright people :smile:
Sergey Kuzminskiy
@OverGreed

Hi guys, I have a question about binding data(ngModel). I am trying to make a simple example:
boot.ts:
import 'reflect-metadata';
import {bootstrap} from 'angular2/platform/browser';
import AppComponent from './app.component';
bootstrap(AppComponent);

app.component.ts:
import {Component} from 'angular2/core';
@Component({
selector:'my-app',
templateUrl: 'templates/app.component.html'
})
export default class AppComponent {
yourName: string = 't1';
test(){
console.log('click');
}
}

app.component.html:

<div>
<label>Name:</label>
<!-- data-bind to the input element; store value in yourName -->
<input type="text" [(ngModel)]="yourName" placeholder="Enter a name here" />
<hr>
<!-- conditionally display `yourName` -->
<h1 [hidden]="!yourName">Hello {{yourName}}!</h1>
<button (click)="test()">Test Click</button>
</div>

the problem is with ngModel always show t1 and never redraw it,
but if I press test button the value is changed it class.
The only different with examples it that I try to build project with Gulp and browserify.

Ken Rimple
@krimple
@jamespacileo Maybe even younger. That's a guestimate - he did intern at Google last summer when he wrote it. That team is scary smart.
Daniel
@gaiottino
So. If I add the listener in System.import('app').then(...) then it's not picked up. http://plnkr.co/edit/X2m7Wp0mYQtkUR4M9NNs?p=preview It must be possible to wrap an external script and not have angular react to all listeners.
Chad Autry
@chad-autry
@chad-autry My issue was firefox doesn't support 'let' out of the box, and IE doesn't support template strings yet.
Cody Lundquist
@meenie
@krimple: Just to be clear why that worked (if you didn't know, or anyone else reading this), every time you "provide" something, it creates a new instance for itself and it's children. Since you were providing the router again in your child component, it didn't have any routes configured anymore.
Daniel
@gaiottino
Does anyone know how to run Angular2 without System.js? I'd like to get my installation into a Rails environment and served using sprockets.
Eric Martinez
@ericmartinezr
Have you tried with some bundling system like jspm or webpack?
Daniel
@gaiottino
@ericmartinezr No. I'm not really used to the node world. Which one do you think would work best? I'll have to read up on whether either is a decent alternative. But for conversation sake, when running a production environment, one does not rely on System.js to load files as needed right? Is the norm not to serve all JS content at once?
Daniel
@gaiottino
@ericmartinezr seems jspm might be a way forward.
Eric Martinez
@ericmartinezr
Right, that's what I've read in this chatroom as well. But I have no experience in the subject. People will always answer : There's not perfect solution, so you would have to see which one works better for you.
You can ask though, and wait for an answer. There's people who know a lot about this, so they can put you in the right path.
Chad Autry
@chad-autry
So its still incomplete and has some issues I'm working out, but thought I'd show the app template I've been working on. http://chad-autry.github.io/ng2bp it at least has some of the basics going.
Kaveh Shahbazian
@dc0d
Using import {Http, HTTP_PROVIDERS} from 'angular2/http'; shows 'Unexpected token <'; is this a bug? Or I'm doing something wrong?
Brandon
@brandonroberts
@dc0d you need to include the http bundle in your scripts
Oleg Korsak
@kamikaze
@brandonroberts https://gitter.im/angular/angular?at=5681792d653b30761d765b91 -- sorry for being away. So you don't even have a working link in left top corner? "Sign up" ?
Brandon
@brandonroberts
@kamikaze yes, the link in the top left corner works, but its outside your route with the form
Oleg Korsak
@kamikaze
yes... that's what I'm talking about. Here is my RouteConfig in app.ts:
```
@Component({
  selector: 'app',
  viewProviders: [AuthenticationService],
  templateUrl: './components/app/app.html',
  styleUrls: ['./components/app/app.css'],
  encapsulation: ViewEncapsulation.None,
  directives: [ROUTER_DIRECTIVES],
  providers: [HTTP_PROVIDERS]
})
@RouteConfig([
  //{path: '/', as: 'Index', redirectTo: '/signin'},
  {path: '/', component: SigninPageComponent, as: 'Index'},
  {path: '/signin', component: SigninPageComponent, as: 'Signin'},
  {path: '/signup', component: SignupPageComponent, as: 'Signup'},
  {path: '/...', component: AuthorizedViewComponent, as: 'AuthorizedView'}
])
export class AppComponent {}
and here is a routerLink:
<a [routerLink]="['/Signup']">Sign Up!</a>
it's the same in top level and in component child component
and it works when you catch a breakpoint in router.js RouterLink -> set()
and then continue
looks like something is not "loaded" when RouterLink executes
so inner link is broken without pause
Brandon
@brandonroberts
Where are you including the angular2-polyfills like reflect-metdata and zone.js?