ng-view的问题无法让它咬人! [英] Issue with ng-view can not get it to bite!
问题描述
了解AngularJS的方法
我有一个运行的应用程序,JS适用于上面的APP,但我不能让JS(AngualrJS)使用视图。
HTML
在HTML中我称之为视图
< body ng-app =myApp>
.......
HTML和JS Code inbetween
。 .......
Learning the Ways of the AngularJS
I have an app running and the JS works for the APP above but I can not get the JS(AngualrJS) to work with the view.
HTML
In the HTML I am calling a view
<body ng-app ="myApp">
.......
HTML and JS Code inbetween
........
New Area
<ng-view>
我有3个一个ng-app上的控制器
JavaScript
我有这个返回视图
var app = angular.module('myApp',['ngRoute']);
.... .......
JS代码之间
........ ...
app.config(['$ routeProvider',
函数($ routeProvider){
$ routeProvider。
when('/ thesum',{
templateUrl:'about.html',
控制器:'myCtrl12'
});
}]);
app.controller('myCtrl2',function(){
var self = this;
self.message =你好! ;
});
我正在学习这个,以便了解如何使其与MSFT MVC世界一起工作,所以宝贝步骤任何帮助都很有用!
I have 3 controllers on the one ng-app
JavaScript
I have this to return the view
var app = angular.module('myApp', ['ngRoute']);
...........
JS Code between
...........
app.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/thesum', {
templateUrl: 'about.html',
controller: 'myCtrl12'
});
}]);
app.controller('myCtrl2', function(){
var self = this;
self.message ="Hello!";
});
I am learning this in order to understand how to get this to work with the MSFT MVC world, so baby steps any help is useful!
推荐答案
routeProvider',
函数(
routeProvider',
function(
routeProvider) {
routeProvider) {
routeProvider。
when('/ thesum',{
templateUrl:'about.html',
控制器:'myCtrl12'
});
}]);
app.controller('myCtrl2',function(){
var self = this;
self.message =你好!;
});
我学习这个以便了解如何使其与MSFT MVC世界一起工作,所以宝贝步骤任何帮助都是有用的!
routeProvider.
when('/thesum', {
templateUrl: 'about.html',
controller: 'myCtrl12'
});
}]);
app.controller('myCtrl2', function(){
var self = this;
self.message ="Hello!";
});
I am learning this in order to understand how to get this to work with the MSFT MVC world, so baby steps any help is useful!
这篇关于ng-view的问题无法让它咬人!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!