Vote count: 0 I'm trying to bootstrap my Angular 2 RC5 application following this guide https://angular.io/docs/ts/latest/guide/ngmodule.html Below is my code import { AppModuleNgFactory } from './app.module.ngfactory'; import {platformBrowser} from "@angular/platform-browser"; platformBrowser().bootstrapModuleFactory(AppModuleNgFactory); However , when I tried to compile typescript code, I got the following error appmain.ts(1,36): error TS2307: Caot find module './app.module.ngfactory'. How can I generate the app.module.ngfactory file? Which tool should I use? asked 1 min agoToan Nguyen Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am having trouble with my Angular JS ui-router and every question I have found on here shows a solutions I have already tried. In my ui-view-tag my actual template is not displayed. This is my app.js angular.module('myApp', ['ui.router']) .config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $stateProvider .state('home', { url: '/', templateUrl: 'home.html', controller: 'MainCtrl' }) $urlRouterProvider.otherwise('home'); }]) Thank you very much everybody, I would really appreciate a short feedback on that. asked 46 secs agopatrick Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm trying to get the current route name in my app.component so that I can use the route name as a page class around a wrapper div. I'm trying to figure out the best way to handle this. Previously I was subscribing the the router changes property like I have listed below, but it seems like is no longer available with @angular/router 3.0.0-alpha.3. If anyone has any thoughts or suggestions I would be most grateful. this.router.changes.subscribe((val) => { var path = this._location.path(); if (path.indexOf('page-name') !== -1) { this.pageClass = 'page-name'; } }) asked 57 secs agoRyan Robison Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am trying to create a simple nested router. This sort of structure worked in the beta builds, but with the launch of the release candidate router I find myself stuck. http://plnkr.co/edit/7KSJpqWuBpkxi1E6tJ The plunkr above is a contrived version of my scenario. Despite having @Routes([ new Route({ path: '/applications/...', component: ApplicationRouter }) ]) the router doesn't appear to be recognising the non-terminal route. Error: Uncaught (in promise): Caot match any routes. Current segment: 'applications'. Available routes: ['/applications/...']. asked 1 min agomattdotdev 1 Answer Vote count: 0 As far as I know in the new router /... isn't necessary for routes that have c...
ادامه مطلبVote count: 0 I'm using angular 1.5.2 and angular ui router 0.2.5, i make a page transition, from a state to another state, only the screen changes, but the controller not change, i tried to do the transition by three different ways: $location.path('/home'); $state.go('home'); $state.transitionTo('home'); the states appTmw.config(function($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/login'); $stateProvider.state('login', { url: '/login', controller: 'LoginCtrl', views: { '': { templateUrl: '/components/login/loginview.html' } } }) .state('home', { url: '/home', controller: 'HomeCtrl', views: { '': { templateUrl: '/components/home/homeView.html' }, 'nav@home': { templa...
ادامه مطلبVote count: 0 I have a JSPM/Typescript/Angular 1.5.3 project. I want to use the new component router. In my project dir, I used the command jspm install npm:@angular/router and it installed fine with no errors. I then added it to my app.ts file with import ngComponentRouter from 'jspm_packages/npm/@angular/router@0.2.0/angular1/angular_1_router' But when I start my lite-server, I get Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/jspm_packages/npm/@angular/instruction.json Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:3000/jspm_packages/npm/@angular/utils.json Failed to load resource: the ...
ادامه مطلب