Loading [MathJax]/jax/output/CommonHTML/config.js
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >没有商店的供应商!injectionError错误

没有商店的供应商!injectionError错误
EN

Stack Overflow用户
提问于 2017-05-21 21:37:52
回答 3查看 7.4K关注 0票数 3

app.component.html

代码语言:javascript
运行
AI代码解释
复制
<page-router-outlet></page-router-outlet>

app.component.ts

代码语言:javascript
运行
AI代码解释
复制
import 'rxjs/add/operator/let';
import { Component, ViewEncapsulation } from '@angular/core';
import { EchoesState, getSidebarCollapsed$ } from './core/store';
import { Store } from '@ngrx/store';

@Component({
   selector: "ns-app",
   templateUrl: "app.component.html",
})
export class AppComponent {
  constructor(private store: Store<EchoesState>){}
}

app.module.ts

代码语言:javascript
运行
AI代码解释
复制
import 'nativescript-localstorage';
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";

import { NativeScriptRouterModule } from "nativescript-angular/router";
import { NativeScriptFormsModule } from "nativescript-angular/forms";

import { AppRoutingModule } from "./app.routing";
import { AppComponent } from "./app.component";

import { ItemService } from "./item/item.service";
import { ItemsComponent } from "./item/items.component";
import { ItemDetailComponent } from "./item/item-detail.component";

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        NativeScriptModule,
        AppRoutingModule
    ],
    declarations: [
        AppComponent,
        ItemsComponent,
        ItemDetailComponent
    ],
    providers: [
        ItemService
    ],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
export class AppModule { }

app.routing.ts

代码语言:javascript
运行
AI代码解释
复制
import { NgModule } from "@angular/core";
import { NativeScriptRouterModule } from "nativescript-angular/router";
import { Routes } from "@angular/router";

import { ItemsComponent } from "./item/items.component";
import { ItemDetailComponent } from "./item/item-detail.component";

const routes: Routes = [
    { path: "", redirectTo: "/items", pathMatch: "full" },
    { path: "items", component: ItemsComponent },
    { path: "item/:id", component: ItemDetailComponent },
];

@NgModule({
    imports: [NativeScriptRouterModule.forRoot(routes)],
    exports: [NativeScriptRouterModule]
})
export class AppRoutingModule { }

main.aot.ts

代码语言:javascript
运行
AI代码解释
复制
import { platformNativeScript } from "nativescript-angular/platform-static";
import { AppModuleNgFactory } from "./app.module.ngfactory";
platformNativeScript().bootstrapModuleFactory(AppModuleNgFactory);

main.ts

代码语言:javascript
运行
AI代码解释
复制
import { platformNativeScriptDynamic } from "nativescript-angular/platform";
import { AppModule } from "./app.module";
platformNativeScriptDynamic().bootstrapModule(AppModule);

package.json

代码语言:javascript
运行
AI代码解释
复制
{
  "android": {
    "v8Flags": "--expose_gc"
  },
  "main": "main.js",
  "name": "tns-template-hello-world-ng",
  "version": "3.0.0"
}

存储/index.js:

代码语言:javascript
运行
AI代码解释
复制
import { Observable } from 'rxjs/Observable';
import { NgModule } from '@angular/core';
import { StoreModule, combineReducers } from '@ngrx/store';
import { compose } from '@ngrx/core/compose';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';

import { localStorageSync } from 'ngrx-store-localstorage';
import 'rxjs/add/operator/let';
import { environment } from '../../environments/environment';
import { getSidebarExpanded } from './app-layout';
import { getAppReducersRegistry, EchoesState, EchoesReducers, EchoesActions } from './reducers';

export { EchoesState } from './reducers';

const actions = EchoesActions; // storeAssets.actions;
const reducers = EchoesReducers; // storeAssets.reducers;
const composeStore = reducers;
const optionalImports = [];
const productionReducer = compose(localStorageSync(Object.keys(reducers), true), combineReducers)(reducers);

export function appReducer(state: any, action: any) {
  return productionReducer(state, action);
}

if (!environment.production) { optionalImports.push(StoreDevtoolsModule.instrumentOnlyWithExtension());
}

@NgModule({
  imports: [
    StoreModule.provideStore(appReducer),
    ...optionalImports
  ],
  declarations: [],
  exports: [],
  providers: [ ...actions ]
})
export class CoreStoreModule {
  constructor() {
    console.log('CoreStoreModule initiated:', reducers);
  }
};

function getAppLayoutState(state$: Observable<EchoesState>) {
  return state$.select(state => state.appLayout);
}
export function getSidebarCollapsed$(state$: Observable<EchoesState>) {
  return state$.select((state) => state.appLayout.sidebarExpanded);
}

储存/减速机

代码语言:javascript
运行
AI代码解释
复制
import { AppLayout, AppLayoutActions, appLayout, appLayoutRegister } from './app-layout';
import { NowChannellistActions, NowChannellistInterface, nowChannellist, nowChannellistRegister } from './now-channellist';
import { NowPlaylistActions, NowPlaylistInterface, nowPlaylist, nowPlaylistRegister } from './now-playlist';
// reducers
import { PlayerActions, YoutubePlayerState, player, playerRegister } from './youtube-player';
import { UploadsList, VideosListActions, search, searchRegister } from './uploads-list';
import { UserProfileActions, UserProfileData, user, userRegister } from './user-profile';

import { Observable } from 'rxjs/Observable';

export interface EchoesState {
  player: YoutubePlayerState;
  nowPlaylist: NowPlaylistInterface;
  nowChannellist: NowChannellistInterface;
  user: UserProfileData;
  search: UploadsList;
  appLayout: AppLayout;
};

export let EchoesReducers = {
  player,
  nowPlaylist,
  nowChannellist,
  user,
  search,
  appLayout,
};

export let EchoesActions = [
  PlayerActions,
  NowPlaylistActions,
  NowChannellistActions,
  UserProfileActions,
  VideosListActions,
  AppLayoutActions
];

export function getAppReducersRegistry() {
  return [
    playerRegister,
    nowPlaylistRegister,
    nowChannellistRegister,
    userRegister,
    searchRegister,
    appLayoutRegister
  ];
};

export function getPlayer$ (state$: Observable<EchoesState>): Observable<YoutubePlayerState> {
  return state$.select(state => state.player);
};

export function getPlayerSearch$ (state$: Observable<EchoesState>): Observable<UploadsList> {
  return state$.select(state => state.search);
};

export function getPlayerSearchResults$ (state$: Observable<EchoesState>): Observable<any[]> {
  return state$.select(state => state.search.results);
};

export function getAppLayout$ ($state: Observable<EchoesState>): Observable<AppLayout> {
  return $state.select(state => state.appLayout);
};

export function getNowPlaylist$ ($state: Observable<EchoesState>): Observable<NowPlaylistInterface> {
  return $state.select(state => state.nowPlaylist);
};

export function getNowChannellist$ ($state: Observable<EchoesState>): Observable<NowChannellistInterface> {
  return $state.select(state => state.nowChannellist);
};

我得到的错误是:

没有商店的供应商! (file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:1238:86)角在(file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:1276:12)角处的误差(file:///data/data/org.nativescript. )MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:2777:19)角在ReflectiveInjector_._getByKeyDefault角(file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:2816:25)角在ReflectiveInjector_._getByKey (file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles( (file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:2617:21)角,(file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:3585:52)角,AppModuleInjector.NgModuleInjector.get角(file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:11046:45)角resolveDep createClass角createDirectiveInstance (file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules角/@角/核心/束/core.umd.js:10730:37)角在(file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:12093:49)角在createViewNodes角,createRootView角在(file:///data/data/org.nativescript.MyApptarchec/files/app/tns_modules/@angular/core/bundles/core.umd.js:13213:42)角callWithDebugContext as createRootView

EN

回答 3

Stack Overflow用户

发布于 2018-02-19 02:32:55

我知道这个问题似乎不存在,但是关于信息,provideStore函数已经不存在了,你应该这么做

代码语言:javascript
运行
AI代码解释
复制
StoreModule.forRoot(/*your reducers here*/)
票数 5
EN

Stack Overflow用户

发布于 2017-05-21 21:39:16

您需要将提供程序添加到NgModule,即提供者下的module.ts,

代码语言:javascript
运行
AI代码解释
复制
providers: [
  Store 
]
票数 2
EN

Stack Overflow用户

发布于 2017-05-30 10:10:42

您应该在主模块(app.module.ts)中导入Store:

代码语言:javascript
运行
AI代码解释
复制
imports: [
  StoreModule.provideStore({ /* your reducers here... */ }),
  ...
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44105335

复制
相关文章
掩模直方图
算法:掩模图像,也称掩膜图像,借鉴于PCB制版过程,似一块玻璃板,玻璃板上白色区域是透明的,黑色区域是不透明的。掩膜有方形掩膜和圆形掩膜等。掩模运算是将该玻璃板覆盖在原始图像透过玻璃板显示出来的部分就是掩模运算的结果图像。掩膜图像应用在感兴趣区、图像屏蔽、图像合成、结构特征提取、特殊形状图像提取等领域。
裴来凡
2022/05/28
4720
掩模直方图
掩模直方图均衡化
算法:掩模图像,也称掩膜图像,借鉴于PCB制版过程,似一块玻璃板,玻璃板上白色区域是透明的,黑色区域是不透明的。掩膜有方形掩膜和圆形掩膜等。掩模运算是将该玻璃板覆盖在原始图像透过玻璃板显示出来的部分就是掩模运算的结果图像。掩膜图像应用在感兴趣区、图像屏蔽、图像合成、结构特征提取、特殊形状图像提取等领域。
裴来凡
2022/05/28
3590
掩模直方图均衡化
以太坊 Iban 地址
中国广东省深圳市龙华新区民治街道溪山美地 518131 +86 13113668890 <netkiller@msn.com>
netkiller old
2018/06/14
2.8K1
以太坊 Iban 地址
以太坊中的iban概念解析
简单地说,以太坊中的iban账号是以太坊为了和传统的银行系统对接而引入的概念, web3.js中提供了以太坊地址和iban地址之间的转换方法。 iban:国际银行账号 iban这个概念源于传统的银行系统,其英文全称为International Bank Account Number, 即国际银行帐号。iban的作用是为全球任意一家银行中的任意一个账户 生成一个全球唯一的账号,以便进行跨行交易。一个iban账号看起来像这样: XE7338O073KYGTWWZN0F2WZ0R8PX5ZPPZS iban地址
用户1408045
2018/06/04
1.7K0
芯片制造之掩模领域中的术语
本文记录芯片制造中的掩模部分术语。 A 名词 解释 AAPSM/Levenson Alternating Aperture Phase Shift Mask (see also Levenson) an etched quartz reticle which incorporates a light blocking layer of chrome or moly silicide coupled with etched quartz trenches, to create alternating 0
为为为什么
2023/02/21
1.3K0
芯片制造之掩模领域中的术语
CVPR 2020丨MaskFlownet:基于可学习遮挡掩模的非对称特征匹配
编者按:在光流预测任务中,形变带来的歧义与无效信息会干扰特征匹配的结果。在这篇 CVPR 2020 Oral 论文中,微软亚洲研究院提出了一种可学习遮挡掩模的非对称特征匹配模块 ,它可以被轻松结合到端到端的基础网络中,无需任何额外数据和计算开销就可以学习到遮挡区域,从而显著改进光流预测的结果。
CV君
2020/05/26
1.3K0
CVPR 2020丨MaskFlownet:基于可学习遮挡掩模的非对称特征匹配
Python的正则表达式_python正则表达式例子
https://github.com/ziishaned/learn-regex/ https://regex101.com/ 在线练习
全栈程序员站长
2022/09/30
6300
jmeter的正则表达式提取器_正则表达式提取
在一个线程组中,B请求需要使用A请求返回的数据,也就是常说的关联,将上一个请求的响应结果作为下一个请求的参数,则需要对A请求的响应报文使用后置处理器,其中最方便最常用的就是正则表达式提取器了。
全栈程序员站长
2022/10/01
4.1K0
jmeter的正则表达式提取器_正则表达式提取
超详细的正则表达式(上:正则表达式语法)
正则表达式定义正则表达式语法,又称规则表达式。(英语: ,在代码中常简写为regex、regexp或RE),正则表达式通常被用来检索、替换那些符合某个模式(规则)的文本。一句话说就是匹配有规律的东西
宜轩
2022/12/26
9220
详细的正则表达式
只能输入数字:"^[0-9]*$"。 只能输入n位的数字:"^\d{n}$"。 只能输入至少n位的数字:"^\d{n,}$"。 只能输入m~n位的数字:。"^\d{m,n}$" 只能输入零和非零开头的
Dawnzhang
2018/10/18
6270
简单的正则表达式
特殊字符 ^ $ * ? + {2} {2,} {2,5} | [] [^] [a-z] . \s \S \w \W [\u4E00-\u9FA5] () \d 常用的6个re中的函数
听城
2018/04/27
1.5K0
linux的正则表达式
正则表达式 (Regular Expression, RE, 或称为常规表示法)是透过一些特殊字符的排列,用以搜寻/取代/删除一列或多列 文字字符串,简单的说,正则表达式就是用在字符串的处理上面的一项『表示式』。正则表达式并不是一个工具程序,而是一个字符串处理的标准依据,如果您想要以正则表达式的方式处理字符串,就得要使用支持正则表达式的工具程序 才行,这类的工具程序很多,例如 vi, sed, awk 等等。
小柒吃地瓜
2020/04/22
1.3K0
PHP基础编程之鬼斧神工的正则表达式-正则表达式初探+常用的正则表达式函数
很多小伙伴在学习php中,正则表达式是一道过不去的坎,初学者在看到正则表达式的复杂符号时,总会一头雾水,丈二的和尚摸不着头脑,冷月在刚刚开始学习正则表达式时也是一头懵。不过,冷月会用由浅入深的讲解正则表达式的基础和简单实战,相信大家看完这篇文章时,会有一定的收获。废话不多说,开启正则表达式的学习吧!let's go!
学长冷月
2020/08/02
6700
js 邮箱正则表达式_匹配邮箱的正则表达式
一个正则表达式就是由普通字符(a~z)以及特殊字符(称为元字符)组成的文字模式。 该模式描述在查找文字主体时待匹配的一个或多个字符串。正则表达式作为一个模板,将某个字符模式与所搜索的字符串进行匹配。 语法:
全栈程序员站长
2022/09/29
5.7K0
js 邮箱正则表达式_匹配邮箱的正则表达式
零零信安-D&D数据泄露报警日报【第44期】
2022.11.14共发现匿名网络资讯信息35,333条;最近7天共发现匿名网络资讯信息470,357条,同比增长-1.5%;最近30天共发现匿名网络资讯信息2,308,458 条。
零零信安
2022/11/15
3180
有趣的正则表达式
听到正则表达式,大家一定不会陌生。工作项目中也经常使用正则表达式来校验文本的是否匹配规则。通常都会直接上网找寻各种格式输入的正则匹配式。比如电话/邮件等等。
deep_sadness
2018/08/30
7980
有趣的正则表达式
常用的正则表达式
正则表达式用于字符串处理、表单验证等场合,实用高效。现将一些常用的表达式收集于此,以备不时之需。
崔笑颜
2020/12/22
9050
正则表达式的使用
preg_filter 执行正则表达式搜索和替换 preg_grep 返回匹配模式的数组条目 preg_last_error 返回最后一个正则执行产生的错误代码 preg_match_all 执行一个全局正则表达式匹配 preg_match 执行一个正则表达式匹配 preg_quote 转义正则表达式字符 preg_replace_callback_array 执行一个正则表达式搜索并且使用一个回调函数进行替换 preg_replace_callback 执行一个正则表达式搜索并且使用一个回调进行替换 preg_replace 执行一个正则表达式的搜索和替换 preg_split 通过一个正则表达式分隔字符串
ianzhi
2019/07/31
9360
书写高效的正则表达式,正则表达式性能优化方法
影响 NFA 类正则表达式(常见语言:GNU Emacs,Java,ergp,less,more,.NET语言,PCRE library,Perl,PHP,Python,Ruby,sed,vi ) 其实主要是它的“回溯”,减少“回溯”次数(减少循环查找同一个字符次数),是提高性能的主要方法。
Yangsh888
2022/03/28
3290
jmeter的正则表达式提取器_正则表达式详解
关于JMeter的使用,花费大量精力写了JMeter的一系列文章,有图有案例,一方面总结起来作为备忘,一方面希望能给初学者一些帮助。觉得有所帮助的朋友,请点个赞,对于疏漏之处也欢迎指教。
全栈程序员站长
2022/10/01
4.3K0
jmeter的正则表达式提取器_正则表达式详解

相似问题

使用PHP switch语句执行多个case

60

Ruby case switch语句,执行每个case

21

使用多个case的多个Switch语句?

51

case/switch语句

11

java switch case语句会对负的int值执行多个case吗?

60
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文