angular-seed

Angular2 Router: add hashtag to url

谁都会走 提交于 2020-02-02 06:29:28
问题 I'm using Angular2 Seed application, and you can find it in the official repo. As you can see, here we have angular2/router imported, and we're using it to create the basic routing of the application. import {Component, ViewEncapsulation} from 'angular2/angular2'; import { RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router'; ... @RouteConfig([ { path: '/', component: HomeCmp, as: 'Home' }, { path: '/about', component: AboutCmp, as: 'About' } ]) export class AppCmp {} My question is: how

Clear service data in AngularJs

二次信任 提交于 2019-12-22 07:41:07
问题 I'm trying to store data in my services similar to the answer in : Processing $http response in service app.factory('myService', function($http) { var promise; var myService = { async: function() { if ( !promise ) { // $http returns a promise, which has a then function, which also returns a promise promise = $http.get('test.json').then(function (response) { // The then function here is an opportunity to modify the response console.log(response); // The return value gets picked up by the then

'http-server' is not recognized as an internal or external command

[亡魂溺海] 提交于 2019-12-09 04:44:46
问题 After installing angular-seed project, i did the following steps: Cloned the repository : git clone https://github.com/angular/angular-seed.git cd angular-seed Then I ran npm install at the end of the install i get: angular-seed@0.0.0 prestart C:\Users\user\Documents\GitHub\comilion\angular-seed npm install angular-seed@0.0.0 postinstall C:\Users\user\Documents\GitHub\myproject\angular-seed bower install angular-seed@0.0.0 start C:\Users\user\Documents\GitHub\myproject\angular-seed http

Angular2 Router: add hashtag to url

大兔子大兔子 提交于 2019-12-05 23:58:31
I'm using Angular2 Seed application, and you can find it in the official repo . As you can see, here we have angular2/router imported, and we're using it to create the basic routing of the application. import {Component, ViewEncapsulation} from 'angular2/angular2'; import { RouteConfig, ROUTER_DIRECTIVES } from 'angular2/router'; ... @RouteConfig([ { path: '/', component: HomeCmp, as: 'Home' }, { path: '/about', component: AboutCmp, as: 'About' } ]) export class AppCmp {} My question is: how can I configure router to add hashtag in my url, to make it looks like: localhost:5555/#/about . Is

Clear service data in AngularJs

扶醉桌前 提交于 2019-12-05 10:06:05
I'm trying to store data in my services similar to the answer in : Processing $http response in service app.factory('myService', function($http) { var promise; var myService = { async: function() { if ( !promise ) { // $http returns a promise, which has a then function, which also returns a promise promise = $http.get('test.json').then(function (response) { // The then function here is an opportunity to modify the response console.log(response); // The return value gets picked up by the then in the controller. return response.data; }); } // Return the promise to the controller return promise;

AngularJS App: How to include .js files into index.html

北慕城南 提交于 2019-12-03 03:37:57
问题 I'm new to angularJS. I managed to build a phonegap app using angularJS. The app is ok and running just fine. The problem is, now that I have a little more understanding on how angularJS works (at least I think I have), I'm worried about my app files structure and code maintainability. My project follows the angular-seed pattern. Angular Seed on GitHub where I have this structure: js app.js controllers.js directives.js services.js filters.js After researching how to structure apps with

'http-server' is not recognized as an internal or external command

房东的猫 提交于 2019-12-03 02:22:45
After installing angular-seed project, i did the following steps: Cloned the repository : git clone https://github.com/angular/angular-seed.git cd angular-seed Then I ran npm install at the end of the install i get: angular-seed@0.0.0 prestart C:\Users\user\Documents\GitHub\comilion\angular-seed npm install angular-seed@0.0.0 postinstall C:\Users\user\Documents\GitHub\myproject\angular-seed bower install angular-seed@0.0.0 start C:\Users\user\Documents\GitHub\myproject\angular-seed http-server -a localhost -p 2324 'http-server' is not recognized as an internal or external command, operable

No provider for PlatformRef error after upgrading to Angular2 RC5 in IE10

亡梦爱人 提交于 2019-12-02 03:05:33
问题 I just upgraded to Angular2 RC5. The app loads fine in all browsers exception IE10. I get an exception "No provider for PlatformRef!" when I bootstrap the application. Everything worked fine in RC4. I saw some posts on the web about this exception, but they were all related to Meteor. I do not use meteor. My project is derived from AngularSeed (previous version that I updated manually to RC5). Any idea on how to fix this? Thanks! In IE10, I get this error: No provider for PlatformRef! {

No provider for PlatformRef error after upgrading to Angular2 RC5 in IE10

筅森魡賤 提交于 2019-12-01 23:34:36
I just upgraded to Angular2 RC5. The app loads fine in all browsers exception IE10. I get an exception "No provider for PlatformRef!" when I bootstrap the application. Everything worked fine in RC4. I saw some posts on the web about this exception, but they were all related to Meteor. I do not use meteor. My project is derived from AngularSeed (previous version that I updated manually to RC5). Any idea on how to fix this? Thanks! In IE10, I get this error: No provider for PlatformRef! { [functions]: , context: <Permission denied>, injectors: [ ], keys: [ ], message: "No provider for

karma TypeError “Cannot read property 'subscribe' of undefined”

寵の児 提交于 2019-11-28 10:26:33
问题 While testing a simple component that has a shared service, the following error message appears, and I cannot manage to make it work, I've tried everything! TypeError: Cannot read property 'subscribe' of undefined lr.component.ts export class LrComponent implements OnDestroy { currentRouter: string; private subscription: Subscription; constructor(private lrService: LrService) { this.subscription = this.lrService.lrNavigation$.subscribe( (currentNav: string) => { this.currentRouter =