here what am i doing wrong??first three messages are shown,but when it comes to sub controller it is not displaying the required output
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="scope.aspx.cs" Inherits="angularpractice.scope" %>
body {
font-family: Algerian;
font-size: 30px;
}
.class1 {
margin: 10px;
padding: 10px;
background-color: aqua;
}
.class2 {
margin: 10px;
padding: 10px;
background-color: burlywood;
}
.class3 {
margin: 10px;
padding: 10px;
background-color: cadetblue;
}
var app = angular.module("myapp", []);
app.run(function ($rootScope)
{
$rootScope.message = "Message from root controller";
});
app.controller("mycontroller", function ($scope, $rootScope)
{
$scope.message = "message from parent controller";
});
app.controller1("mycontroller1", function ($scope, $rootScope)
{
$scope.message = "message from sub controller";
});
{{message}}
{{message}}
{{$root.message}}
{{message}}
{{$root.message}}
{{message}}
{{$root.message}}
{{message}}
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ramesh PalanivelPosted Feb 12, 2018, 4:09 AM