草庐IT

AngularJS2

全部标签

javascript - 使用 AngularJS 加载 JSON 文件

我刚开始学习Angular,我一直在寻找使用angular加载JSON文件的解决方案,我已经完成了其他人发布的解决方案,但我无法从我的json文件中获取数据以显示一些原因。我的json文件(test.json)很简单:{"array":[{"thing":"thing1"},{"thing":"thing2"},{"thing":"thing3"}],"name":"robert"}这是我的js文件:varmyMod=angular.module("myMod",[]);myMod.controller("myCont",function($scope,$http){$scope.th

javascript - 使用 AngularJS 加载 JSON 文件

我刚开始学习Angular,我一直在寻找使用angular加载JSON文件的解决方案,我已经完成了其他人发布的解决方案,但我无法从我的json文件中获取数据以显示一些原因。我的json文件(test.json)很简单:{"array":[{"thing":"thing1"},{"thing":"thing2"},{"thing":"thing3"}],"name":"robert"}这是我的js文件:varmyMod=angular.module("myMod",[]);myMod.controller("myCont",function($scope,$http){$scope.th

javascript - 使用 AngularJS 和 Canvas 实现流程图

我正在尝试使用AngularJS和Canvas实现流程图。我不想为用户提供可以拖放UI组件的UI,而是想构建一个命令行工具,用户将在其中输入命令来绘制圆圈,这会将命令转换为JSON对象并在Canvas中呈现该对象。是否有任何库可用于使用JSON对象呈现UI组件? 最佳答案 canvas是硬性要求还是可以是SVG?如果是这样,您可以尝试AngularJS-FlowChart(Demo/Article/Tutorial)或angular-jointjs-graph(Demo)。 关于java

javascript - 使用 AngularJS 和 Canvas 实现流程图

我正在尝试使用AngularJS和Canvas实现流程图。我不想为用户提供可以拖放UI组件的UI,而是想构建一个命令行工具,用户将在其中输入命令来绘制圆圈,这会将命令转换为JSON对象并在Canvas中呈现该对象。是否有任何库可用于使用JSON对象呈现UI组件? 最佳答案 canvas是硬性要求还是可以是SVG?如果是这样,您可以尝试AngularJS-FlowChart(Demo/Article/Tutorial)或angular-jointjs-graph(Demo)。 关于java

javascript - 无法在 AngularJS 中动态获取 radio 选择设置的值

以下是我的代码,其中我没有为每个相应的行选择单选选项,让我知道我在这里做错了什么。我的Plnkr代码-http://plnkr.co/edit/MNLOxKqrlN5ccaUs5gpT?p=preview虽然我得到了classes对象的名称,但没有得到选择。HTML代码-NameChoice1Choice2Choice3Submit{{classes}}脚本文件-varmyApp=angular.module('myApp',[]);myApp.controller('myCtrl',function($scope){$scope.reqgrps=[{name:'Sub1',roll:

javascript - 无法在 AngularJS 中动态获取 radio 选择设置的值

以下是我的代码,其中我没有为每个相应的行选择单选选项,让我知道我在这里做错了什么。我的Plnkr代码-http://plnkr.co/edit/MNLOxKqrlN5ccaUs5gpT?p=preview虽然我得到了classes对象的名称,但没有得到选择。HTML代码-NameChoice1Choice2Choice3Submit{{classes}}脚本文件-varmyApp=angular.module('myApp',[]);myApp.controller('myCtrl',function($scope){$scope.reqgrps=[{name:'Sub1',roll:

javascript - AngularJS + Facebook 喜欢指令不起作用

我正在开发一个在View中集成类似fb的AngularJs应用程序。它仅在第一次运行时有效,如果我也刷新浏览器,当我导航到其他View并返回时,该插件将不起作用。我已经创建了一个指令。angular.module('myApp.directives',[]).directive('fbLike',['$timeout',function($timeout){return{restrict:'A',scope:{},template:"",link:function($scope,$element,$attrs){varworking,_ref,_ref1;$scope.page="ht

javascript - AngularJS + Facebook 喜欢指令不起作用

我正在开发一个在View中集成类似fb的AngularJs应用程序。它仅在第一次运行时有效,如果我也刷新浏览器,当我导航到其他View并返回时,该插件将不起作用。我已经创建了一个指令。angular.module('myApp.directives',[]).directive('fbLike',['$timeout',function($timeout){return{restrict:'A',scope:{},template:"",link:function($scope,$element,$attrs){varworking,_ref,_ref1;$scope.page="ht

javascript - AngularJS orderBy 数组索引

我有一个ng-repeat看起来像这样:{{questions[key].question}}{{questions[key].answer}}Controller看起来像这样:(function(){varapp=angular.module('questionnaire',[]);app.controller('QuestionnaireCtrl',function($scope){$scope.questions={someItem:{question:'Firstquestion'},anotherItem:{question:'Nextquestionhere'},upgra

javascript - AngularJS orderBy 数组索引

我有一个ng-repeat看起来像这样:{{questions[key].question}}{{questions[key].answer}}Controller看起来像这样:(function(){varapp=angular.module('questionnaire',[]);app.controller('QuestionnaireCtrl',function($scope){$scope.questions={someItem:{question:'Firstquestion'},anotherItem:{question:'Nextquestionhere'},upgra