Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:49
    ngbot[bot] milestoned #43866
  • 10:49
    ngbot[bot] milestoned #43866
  • 10:49
    ngbot[bot] milestoned #43866
  • 10:49
    crisbeto labeled #43866
  • 10:49
    crisbeto labeled #43866
  • 10:49
    crisbeto labeled #43866
  • 10:49
    pullapprove[bot] review_requested #43866
  • 10:49
    crisbeto ready_for_review #43866
  • 10:10
    ngbot[bot] milestoned #43865
  • 10:10
    ngbot[bot] milestoned #43865
  • 10:10
    ngbot[bot] milestoned #43865
  • 10:10
    gkalpak labeled #43865
  • 10:10
    gkalpak labeled #43865
  • 10:10
    gkalpak labeled #43865
  • 10:09
    crisbeto labeled #43841
  • 10:09
    crisbeto assigned #43841
  • 10:08
    google-cla[bot] labeled #43866
  • 10:08
    crisbeto opened #43866
  • 08:44
    dburenok starred angular/angular
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?

Oleg Korsak
@kamikaze
@brandonroberts any ideas?
Brandon
@brandonroberts
@kamikaze can’t really tell since its minified, but it seems like your route component is missing a dependency.
Oleg Korsak
@kamikaze
@brandonroberts yeah, you were right :) thanks a lot again
Brandon
@brandonroberts
:-)
Alexander Wieser
@crystalbyte
Good evening.
Whats the ideal way to access DOM properties such as window, document inside a component ?
Alexander Wieser
@crystalbyte
@qdouble Thanks for the hint, these two, however, only allow access to the DOM of the component itself, not to the root, such as window or document.
I know I can simply call the cssSelector, however this seems a bit fishy and indirect, just thought there might be a better way.
Anthony
@qdouble
@crystalbyte I think it's been said a few times on here that angular and other frameworks are purposely set up for there not to be direct dom access
Alexander Wieser
@crystalbyte
@qdouble How do you then for instance call setTimeout, which sometimes is necessary in order for angular to work properly ?
Eric Martinez
@ericmartinezr
like this
setTimeout(() => { ... }, time);
Alexander Wieser
@crystalbyte
@ericmartinezr I know this is possible, I just thought there is a more clean way to call window methods apart from the global scope.
Justin DuJardin
@justindujardin
@crystalbyte Use TimerWrapper perhaps?
import {TimerWrapper} from "angular2/src/facade/async”;
Eric Martinez
@ericmartinezr
I don't think calling a wrapper for something global is cleaner. You're wrapping B in A to use B, doesn't really make sense to me. Internal wrappers have another purpose in the internal API.
Alexander Wieser
@crystalbyte
@justindujardin Thanks, however this does only solve the problem for a single method, I was hoping for a more generic way to access the root objects.
Perhaps it's just me, I come from the C++/C# land far far away, where the global scope has been banished from the lands :P