Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ken Rimple
@krimple
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?
Oleg Korsak
@kamikaze
me?
Brandon
@brandonroberts
@kamikaze yep
@kamikaze based on your source you’re missing the angular2-polyfills.js in your shims section
hm
will try to fix that
any doc on this?
Oleg Korsak
@kamikaze
hmmmm
actually my project is right from that repo... :) strange that my config misses that
thanks
@brandonroberts thanks a lot, it worked!
Brandon
@brandonroberts
@kamikaze :+1:
Oleg Korsak
@kamikaze
but another thing is that location doesn't change in address bar
when you click signup
but it changes when I manually navigate to the same route in code
why is that?
Chad Autry
@chad-autry
I have

I have

router.config([
                { path: '/home', component: homeComponent, name: 'Home', useAsDefault: true },

And that will re-route locally when I hit the html file, but not when hosted with github pages. Anyone have a clue why?